Answer the question
In order to leave comments, you need to log in
Why is external file not included in phpunit?
There is the following directory structure in the project root:
--core
----static-info
--------GettingStaticInfo.php
--tests
----static-info
--------GettingStaticInfoTest.php
--vendor GettingStaticInfo.php
file
<?php
//namespace Enkelad\Mednotifier\StaticInfo;
require_once '../../vendor/autoload.php';
use DiDom\Document;
use JonnyW\PhantomJs\Client;
class GettingStaticInfo
{
...
public function form_url(int ...$args)
{...}
...
<?php
declare (strict_types = 1);
//namespace Tests\StaticInfo;
use PHPUnit\Framework\TestCase;
//use Enkelad\Mednotifier\StaticInfo\GettingStaticInfo;
require_once '../../core/static-info/GettingStaticInfo.php';
final class GettingStaticInfoTest extends TestCase
{
public function testFormUrlNoArg() : void
{
$staticInfo = new GettingStaticInfo();
$url = $staticInfo->form_url();
$this->assertEquals('http://jonnyw.me', $url);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question