lundi 27 juin 2016

PHPUnit: Failed to open stream: No such file or directory

I just install PHPUnit Testing and for some reason it won't read my file. I'm sure it's in the correct path, but why PHPUnit can't find it?

Here is my sample code..................................

functions.php

<?php 

 function my_addition($arg1, $arg2){
        return $arg1 + $arg2;

 ?>

Here is the code and the file to test................................

functions_test.php

<?php 


use PHPUnit\Framework\TestCase;




class functions_test extends TestCase {


public function testmy_addition() {
    include("./data/functions.php");
    $result = my_addition(1,1);
    $this->assertEquals(2, $result);

}


}


?>

What can I do to get it to work and make it pass?

Aucun commentaire:

Enregistrer un commentaire