File tree 5 files changed +59
-2
lines changed
5 files changed +59
-2
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ Blanket is a Simple REST microframework similar to Rack or Silex.
5
5
To run tests:
6
6
7
7
$ composer install
8
- $ ./vendor/phpspec/phpspec/bin/phpspec run
8
+ $ ./vendor/phpspec/phpspec/bin/phpspec run
9
+ $ ./vendor/bin/phpunit --configuration=./phpunit.xml
Original file line number Diff line number Diff line change 8
8
}
9
9
},
10
10
"require-dev" : {
11
- "phpspec/phpspec" : " ^3.2"
11
+ "phpspec/phpspec" : " ^3.2" ,
12
+ "phpunit/phpunit" : " ^5.7"
12
13
}
13
14
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require __DIR__ . '/vendor/autoload.php ' ;
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit backupGlobals =" false"
3
+ backupStaticAttributes =" false"
4
+ bootstrap =" phpunit.php"
5
+ colors =" true"
6
+ convertErrorsToExceptions =" true"
7
+ convertNoticesToExceptions =" true"
8
+ convertWarningsToExceptions =" true"
9
+ processIsolation =" false"
10
+ stopOnFailure =" false"
11
+ syntaxCheck =" false"
12
+ >
13
+ <testsuites >
14
+ <testsuite name =" Blanket Test Suite" >
15
+ <directory >./test/</directory >
16
+ </testsuite >
17
+ </testsuites >
18
+
19
+ <filter >
20
+ <whitelist addUncoveredFilesFromWhitelist =" false" >
21
+ <directory suffix =" .php" >src</directory >
22
+ <exclude >
23
+ <directory suffix =" .php" >vendor</directory >
24
+ </exclude >
25
+ </whitelist >
26
+ </filter >
27
+ </phpunit >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use Blanket \App ;
4
+ use Blanket \Request ;
5
+
6
+ class AppGetTest extends PHPUnit_Framework_TestCase {
7
+
8
+ function testGetRequest () {
9
+ /** @var Request $request */
10
+ $ request = $ this ->getMockBuilder (Request::class)->getMock ();
11
+
12
+ $ data = ['hi ' => 'there ' ];
13
+
14
+ $ app = new App ();
15
+ $ app ->get ('funky ' , function () use ($ data ) {
16
+ return $ data ;
17
+ });
18
+
19
+ $ request ->method = 'get ' ;
20
+ $ request ->path = 'funky ' ;
21
+
22
+ $ this ->assertEquals ($ data , $ app ->getResponse ($ request ));
23
+ }
24
+
25
+ }
You can’t perform that action at this time.
0 commit comments