روز برنامه‌نویس مبارک 🤩🎉 از هدایای روز برنامه‌نویس جا نمونی ⌛
۰ ثانیه
۰ دقیقه
۰ ساعت
۳ سید جمال جلالی
سوال در خصوص دریافت body مربوط به response
جامعه پی اچ پی ایجاد شده در ۱۶ مهر ۱۴۰۱

سلام

دقیقه 5 آموزش وقتی وقتی این کد ران میشه

echo $response->getBody();

و من انتظار دارم این خروجی(var_dump('HIIIIII')) که داخل Index.php تعریف کردم نشون داده بشه....

ولی این اتفاق نمیوفته و یه متن HTML که انگار سورس کد html همون صفحه index.php رو نشون میده ؟؟؟

$ vendor/bin/phpunit
PHPUnit 9.5.25 #StandWithUkraine
Runtime:    PHP 8.1.6
Configuration: C:\\xampp\\htdocs\\TDD-ORM-Project\\bug-tracker\\phpunit.xml
.................Fhtml>
<html lang="en">
 <head>
  <meta charset="utf-8">
  
  <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Welcome to XAMPPtitle>
  <meta name="description" content="XAMPP is an easy to install Apache distribution containing MariaDB, PHP and Perl." /> 
  <meta name="keywords" content="xampp, apache, php, perl, mariadb, open source distribution" />
  <link href="/dashboard/stylesheets/normalize.css" rel="stylesheet" type="text/css" /><link href="/dashboard/stylesheets/all.css" rel="stylesheet" type="text/css" />
  <link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
  <script src="/dashboard/javascripts/modernizr.js" type="text/javascript">script>
  <link href="/dashboard/images/favicon.png" rel="icon" type="image/png" />
 head>
 <body class="index">
  <div id="fb-root">div>
  <script>(function(d, s, id) {
   var js, fjs = d.getElementsByTagName(s)[0];
   if (d.getElementById(id)) return;
   js = d.createElement(s); js.id = id;
   js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=277385395761685";
   fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));script>
  <div class="contain-to-grid">
   <nav class="top-bar" data-topbar>
    <ul class="title-area">
     <li class="name">
      <h1><a href="/dashboard/index.html">Apache Friendsa>h1>
     li>
     <li class="toggle-topbar menu-icon">
      <a href="#">
       <span>Menuspan>
      a>
     li>
    ul>
    <section class="top-bar-section">
     
     <ul class="right">
       <li class=""><a href="/applications.html">Applicationsa>li>
       <li class=""><a href="/dashboard/faq.html">FAQsa>li>
       <li class=""><a href="/dashboard/howto.html">HOW-TO Guidesa>li>
       <li class=""><a target="_blank" href="/dashboard/phpinfo.php">PHPInfoa>li>
       <li class=""><a href="/phpmyadmin/">phpMyAdmina>li>
     ul>
    section>
   nav>
  div>
  <div id="wrapper">
   <div class="hero">
 <div class="row">
  <div class="large-12 columns">
   <h1><img src="/dashboard/images/xampp-logo.svg" />XAMPP <span>Apache + MariaDB + PHP + Perlspan>h1>
  div>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <h2>Welcome to XAMPP for Windows 8.1.6h2>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <p>
   You have successfully installed XAMPP on this system! Now you can start using Apache, MariaDB, PHP and other components.
   You can find more info in the <a href="/dashboard/faq.html">FAQsa> section or check the <a href="/dashboard/howto.html">HOW-TO Guidesa> for getting started with PHP applications.
  p>
  <p>
   XAMPP is meant only for development purposes. It has certain configuration settings that make it easy to develop locally but that are insecure if you want to have your installation accessible to others.
   If you want have your XAMPP accessible from the internet, make sure you understand the implications and you checked the <a href="/dashboard/faq.html">FAQsa> to learn how to protect your site. Alternatively you can use <a href="https://bitnami.com/stack/wamp">WAMPa>, <a href="https://bitnami.com/stack/mamp">MAMPa> or <a href="https://bitnami.com/stack/lamp">LAMPa> which are similar packages which are more suitable for production.
  p>
  <p>
   Start the XAMPP Control Panel to check the server status.
  p>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <h3>Communityh3>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <p>
   XAMPP has been around for more than 10 years  there is a huge community behind it. You can get involved by joining our <a href="https://community.apachefriends.org">Forumsa>, adding yourself to the <a href="https://www.apachefriends.org/community.html#mailing_list">Mailing Lista>, and liking us on <a href="https://www.facebook.com/we.are.xampp">Facebooka>, following our exploits on <a href="https://twitter.com/apachefriends">Twittera>, or adding us to your <a href="https://plus.google.com/+xampp/posts">Google+a> circles.
  p>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <h3>Contribute to XAMPP translation at <a href="https://translate.apachefriends.org/">translate.apachefriends.orga>.h3>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <p>
   Can you help translate XAMPP for other community members? We need your help to translate XAMPP into different languages. We have set up a site, <a href="https://translate.apachefriends.org/">translate.apachefriends.orga>, where users can contribute translations.
  p>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <h3>Install applications on XAMPP using Bitnamih3>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <p>
  Apache Friends and Bitnami are cooperating to make dozens of open source applications available on XAMPP, for free. Bitnami-packaged applications include Wordpress, Drupal, Joomla! and dozens of others and can be deployed with one-click installers.
  Visit the <a target="_blank" href="http://bitnami.com/stack/xampp?utm_source=bitnami&utm_medium=installer&utm_campaign=XAMPP%2BModule">Bitnami XAMPP pagea> for details on the currently available apps.
  p>
 div>
div>
<div class="row">
 <div class="large-12 columns">
  <a href="http://bitnami.com/stack/xampp?utm_source=bitnami&utm_medium=installer&utm_campaign=XAMPP%2BModule" target="_blank"><img alt="Bitnami XAMPP page" src="/dashboard/images/bitnami-xampp.png" />a>
 div>
div>
  div>
  <footer>
   <div class="row">
    <div class="large-12 columns">
     <div class="row">
      <div class="large-8 columns">
       <ul class="social">
 <li class="twitter"><a href="https://twitter.com/apachefriends">Follow us on Twittera>li>
 <li class="facebook"><a href="https://www.facebook.com/we.are.xampp">Like us on Facebooka>li>
 <li class="google"><a href="https://plus.google.com/+xampp/posts">Add us to your G+ Circlesa>li>
ul>
       <ul class="inline-list">
        <li><a href="https://www.apachefriends.org/blog.html">Bloga>li>
        <li><a href="https://www.apachefriends.org/privacy_policy.html">Privacy Policya>li>
        <li>
<a target="_blank" href="http://www.fastly.com/">          CDN provided by
          <img width="48" data-2x="/dashboard/images/fastly-logo@2x.png" src="/dashboard/images/fastly-logo.png" />
a>        li>
       ul>
      div>
      <div class="large-4 columns">
       <p class="text-right">Copyright (c) 2018, Apache Friendsp>
      div>
     div>
    div>
   div>
  footer>
  
  <script src="//code.jquery.com/jquery-1.10.2.min.js">script>
  <script src="/dashboard/javascripts/all.js" type="text/javascript">script>
 body>
html>
...                       21 / 21 (100%)
Time: 00:00.289, Memory: 8.00 MB
There was 1 failure:
1) Tests\\Functional\\CrudTest::testItCanCreateDataWithAPI
Failed asserting that null is not null.
C:\\xampp\\htdocs\\TDD-ORM-Project\\bug-tracker\\tests\\Functional\\CrudTest.php:51
FAILURES!
Tests: 21, Assertions: 35, Failures: 1.

این اجرا میشه !!!!!!!!!!!!!!!!1

سید جمال جلالی ۱۶ مهر ۱۴۰۱، ۱۵:۰۲

داخل پوشه app.php رو به شکل زیر تغییر دادم درست شد!!!!!

return [
    'base_uri' => 'http://localhost/TDD-ORM-Project/bug-tracker/'
];


ولی علتشو نفهمیدم چرا برای شما به شکل زیر کار میکرد ؟؟؟؟؟؟؟؟

return [
    'base_uri' => 'http://localhost'
];
سید جمال جلالی ۱۶ مهر ۱۴۰۱، ۱۵:۴۲

سلام دوست عزیز

طبق راه حل مشکلی که نوشتید اگر اشتباه نکنم احتمالا بحث path قرارگیری پروژه هم مطرح

محمد گازری ۱۶ مهر ۱۴۰۱، ۱۵:۵۹