This repository was archived by the owner on Apr 17, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 "stack/builder" : " *"
1717 },
1818 "require-dev" : {
19- "satooshi/php-coveralls" : " *"
19+ "satooshi/php-coveralls" : " *" ,
20+ "phpunit/phpunit" : " 4.2"
2021 },
2122 "autoload" : {
2223 "psr-4" : {
Original file line number Diff line number Diff line change 1+ ; This is your default config file which is always included
2+ ; Environment specific config files will be included after to override these defaults
3+
14[kernel]
25default = \Skeleton\Project
36
@@ -7,4 +10,3 @@ gzip = false
710[dispatch]
811run_on = path
912run_match = assets
10- aliases[src] = src/res
Original file line number Diff line number Diff line change 1+ ; This is the configuration file used when running unit tests
2+
3+ [test]
4+ username = test
5+ password = test
Original file line number Diff line number Diff line change 99 processIsolation =" false"
1010 stopOnFailure =" false"
1111 syntaxCheck =" false"
12- bootstrap =" vendor/autoload .php"
12+ bootstrap =" ./ vendor/cubex/framework/testing/bootstrap .php"
1313 >
1414 <testsuites >
15- <testsuite name =" Cubex Test Suite" >
15+ <testsuite name =" Project Test Suite" >
1616 <directory >./tests</directory >
1717 </testsuite >
1818 </testsuites >
19+ <filter >
20+ <whitelist >
21+ <directory suffix =" .php" >src</directory >
22+ </whitelist >
23+ <blacklist >
24+ <directory suffix =" .php" >vendor</directory >
25+ <directory suffix =" .php" >tests</directory >
26+ </blacklist >
27+ </filter >
1928</phpunit >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public function getRoutes()
1515 return [
1616 'hello/world ' => 'hello ' , //Run the renderHello method
1717 'google ' => 'http://www.google.com ' , //Redirect to url
18- 'hi ' => '#@hello/world ' , //Redirect to hello/world
18+ 'hi ' => '#@/ hello/world ' , //Redirect to hello/world
1919 ];
2020 }
2121
Original file line number Diff line number Diff line change 11<?php
2+ namespace Tests ;
23
3- class ProjectTest extends PHPUnit_Framework_TestCase
4+ use Cubex \Testing \CubexTestCase ;
5+
6+ class ProjectTest extends CubexTestCase
47{
58 public function testProjectIsCubexKernel ()
69 {
7- $ cubex = new \Cubex \Cubex (__DIR__ );
8- $ cubex ->prepareCubex ();
9- $ cubex ->processConfiguration ($ cubex ->getConfiguration ());
10-
1110 $ this ->assertInstanceOf (
1211 '\Cubex\Kernel\CubexKernel ' ,
13- $ cubex ->make ('\Cubex\Kernel\CubexKernel ' )
12+ $ this -> getCubex () ->make ('\Cubex\Kernel\CubexKernel ' )
1413 );
1514 }
15+
16+ public function testDefaultAction ()
17+ {
18+ $ this ->getResponse ('/ ' );
19+ $ this ->assertResponseContains ('Welcome to Cubex ' );
20+ $ this ->assertResponseOk ();
21+ $ this ->assertReturnsCubexResponse ();
22+ }
23+
24+ public function testHello ()
25+ {
26+ $ this ->getResponse ('/hello ' );
27+ $ this ->assertResponseContains ('Hello World ' );
28+ }
29+
30+ public function testHi ()
31+ {
32+ $ this ->getResponse ('/hi ' );
33+ $ this ->assertRedirectedTo ('/hello/world ' );
34+ }
1635}
You can’t perform that action at this time.
0 commit comments