// use PHPUnit\Framework\TestCase;
class PrimesTest extends PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function test_should_return_false()
{
$this->assertTrue(true);
}
}
Mar 2, 2017
3
Level 14
Basic php project with phpunit
Hi guys and girls :) . I am trying to build a simple project in php with tests. the folder structure is as follows:
root/
src/
Primes.php
tests/
PrimesTest.php
vendor/
composer.json
phpunit.xml
The problem is .. when I run phpunit it says No tests executed
PrimesTest.php
use PHPUnit\Framework\TestCase;
class PrimesTest extends TestCase
{
/**
* @test
*/
public function test_should_return_false()
{
$this->assertTrue(true);
}
}
composer.json
{
"require": {
"tightenco/collect": "^5.4"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
},
"autoload": {
"classmap": [
"src",
"tests"
],
"psr-4": {
"Tests\\": "tests/",
"App\\": "src/"
}
}
}
phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
I am stuck.. I have no clue why it doesn't run the test
Level 104
1 like
Please or to participate in this conversation.