jeudi 26 janvier 2017

PHPUnit doesn't see files from other folder

I have such structure of my project: Root/src Root/tests

In tests folder I write my tests. When all includes files are in Root folder all work fine, but when I want to put my files in src I get error:

Warning: require(../src/Task1.php): failed to open stream: No such file or    directory in E:\xampp\htdocs\CodewarsPHP\tests\Task1Test.php on line 2

Fatal error: require(): Failed opening required '../src/Task1.php'    (include_path='E:\xampp\php\PEAR') in    E:\xampp\htdocs\CodewarsPHP\tests\Task1Test.php on 2 line

My test file:

<?php
require '../src/Task1.php';
class Task1Test extends PHPUnit_Framework_TestCase
{
public function testTask1(){
    $this->assertEquals([1,1,1,3,5,9],fib([1,1,1],6));
}
}

Aucun commentaire:

Enregistrer un commentaire