File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed
Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 66 "App\\ " : " app/"
77 }
88 },
9+ "autoload-dev" : {
10+ "psr-4" : {
11+ "Tests\\ " : " tests/"
12+ }
13+ },
914 "authors" : [
1015 {
1116 "name" : " liutao" ,
1722 "microphp/framework" : " dev-master"
1823 },
1924 "require-dev" : {
20- "friendsofphp/php-cs-fixer" : " ^3.22.0"
25+ "friendsofphp/php-cs-fixer" : " ^3.22.0" ,
26+ "phpunit/phpunit" : " ^10.2"
2127 },
2228 "scripts" : {
2329 "cs" : [
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" ./vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap =" ./bin/bootstrap.php"
5+ colors =" true"
6+ >
7+ <testsuites >
8+ <testsuite name =" Unit" >
9+ <directory suffix =" Test.php" >./tests/Unit</directory >
10+ </testsuite >
11+ <testsuite name =" Feature" >
12+ <directory suffix =" Test.php" >./tests/Feature</directory >
13+ </testsuite >
14+ </testsuites >
15+ <source >
16+ <include >
17+ <directory suffix =" .php" >./app</directory >
18+ </include >
19+ </source >
20+ <php >
21+ <env name =" APP_ENV" value =" testing" />
22+ </php >
23+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Tests \Feature \Controller ;
6+
7+
8+ use League \Route \Route ;
9+ use League \Route \Router ;
10+ use MicroPHP \Framework \Application ;
11+ use MicroPHP \Framework \Testing \TestCase ;
12+ use Psr \Container \ContainerExceptionInterface ;
13+ use Psr \Container \NotFoundExceptionInterface ;
14+
15+ class IndexTest extends TestCase
16+ {
17+ public function test_index ()
18+ {
19+ $ result = $ this ->get ('http://127.0.0.1:8080 ' )->assertOk ();
20+ $ this ->assertSame ('Hello World ' , $ result ->getContent ());
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments