-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4511656
commit 016b443
Showing
8 changed files
with
346 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,64 @@ | |
namespace Phalcon\Test\Integration\Mvc\Router\Group; | ||
|
||
use IntegrationTester; | ||
use Phalcon\Mvc\Router; | ||
use Phalcon\Mvc\Router\Group; | ||
use Phalcon\Test\Fixtures\Traits\RouterTrait; | ||
|
||
/** | ||
* Class AddDeleteCest | ||
*/ | ||
class AddDeleteCest | ||
{ | ||
use RouterTrait; | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Router\Group :: addDelete() | ||
* | ||
* @param IntegrationTester $I | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
* @author Sid Roberts <[email protected]> | ||
* @since 2019-04-17 | ||
*/ | ||
public function mvcRouterGroupAddDelete(IntegrationTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Router\Group - addDelete()'); | ||
$I->skipTest('Need implementation'); | ||
|
||
$router = $this->getRouter(false); | ||
|
||
$group = new Group(); | ||
|
||
$group->addDelete( | ||
'/docs/index', | ||
[ | ||
'controller' => 'documentation6', | ||
'action' => 'index', | ||
] | ||
); | ||
|
||
$router->mount($group); | ||
|
||
|
||
|
||
$_SERVER['REQUEST_METHOD'] = 'DELETE'; | ||
|
||
$router->handle('/docs/index'); | ||
|
||
|
||
|
||
$I->assertEquals( | ||
'documentation6', | ||
$router->getControllerName() | ||
); | ||
|
||
$I->assertEquals( | ||
'index', | ||
$router->getActionName() | ||
); | ||
|
||
$I->assertEquals( | ||
[], | ||
$router->getParams() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,64 @@ | |
namespace Phalcon\Test\Integration\Mvc\Router\Group; | ||
|
||
use IntegrationTester; | ||
use Phalcon\Mvc\Router; | ||
use Phalcon\Mvc\Router\Group; | ||
use Phalcon\Test\Fixtures\Traits\RouterTrait; | ||
|
||
/** | ||
* Class AddGetCest | ||
*/ | ||
class AddGetCest | ||
{ | ||
use RouterTrait; | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Router\Group :: addGet() | ||
* | ||
* @param IntegrationTester $I | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
* @author Sid Roberts <[email protected]> | ||
* @since 2019-04-17 | ||
*/ | ||
public function mvcRouterGroupAddGet(IntegrationTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Router\Group - addGet()'); | ||
$I->skipTest('Need implementation'); | ||
$I->wantToTest('Mvc\Router - addGet()'); | ||
|
||
$router = $this->getRouter(false); | ||
|
||
$group = new Group(); | ||
|
||
$group->addGet( | ||
'/docs/index', | ||
[ | ||
'controller' => 'documentation4', | ||
'action' => 'index', | ||
] | ||
); | ||
|
||
$router->mount($group); | ||
|
||
|
||
|
||
$_SERVER['REQUEST_METHOD'] = 'GET'; | ||
|
||
$router->handle('/docs/index'); | ||
|
||
|
||
|
||
$I->assertEquals( | ||
'documentation4', | ||
$router->getControllerName() | ||
); | ||
|
||
$I->assertEquals( | ||
'index', | ||
$router->getActionName() | ||
); | ||
|
||
$I->assertEquals( | ||
[], | ||
$router->getParams() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,64 @@ | |
namespace Phalcon\Test\Integration\Mvc\Router\Group; | ||
|
||
use IntegrationTester; | ||
use Phalcon\Mvc\Router; | ||
use Phalcon\Mvc\Router\Group; | ||
use Phalcon\Test\Fixtures\Traits\RouterTrait; | ||
|
||
/** | ||
* Class AddHeadCest | ||
*/ | ||
class AddHeadCest | ||
{ | ||
use RouterTrait; | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Router\Group :: addHead() | ||
* | ||
* @param IntegrationTester $I | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
* @author Sid Roberts <[email protected]> | ||
* @since 2019-04-17 | ||
*/ | ||
public function mvcRouterGroupAddHead(IntegrationTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Router\Group - addHead()'); | ||
$I->skipTest('Need implementation'); | ||
$I->wantToTest('Mvc\Router - addHead()'); | ||
|
||
$router = $this->getRouter(false); | ||
|
||
$group = new Group(); | ||
|
||
$group->addHead( | ||
'/docs/index', | ||
[ | ||
'controller' => 'documentation8', | ||
'action' => 'index', | ||
] | ||
); | ||
|
||
$router->mount($group); | ||
|
||
|
||
|
||
$_SERVER['REQUEST_METHOD'] = 'HEAD'; | ||
|
||
$router->handle('/docs/index'); | ||
|
||
|
||
|
||
$I->assertEquals( | ||
'documentation8', | ||
$router->getControllerName() | ||
); | ||
|
||
$I->assertEquals( | ||
'index', | ||
$router->getActionName() | ||
); | ||
|
||
$I->assertEquals( | ||
[], | ||
$router->getParams() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,64 @@ | |
namespace Phalcon\Test\Integration\Mvc\Router\Group; | ||
|
||
use IntegrationTester; | ||
use Phalcon\Mvc\Router; | ||
use Phalcon\Mvc\Router\Group; | ||
use Phalcon\Test\Fixtures\Traits\RouterTrait; | ||
|
||
/** | ||
* Class AddOptionsCest | ||
*/ | ||
class AddOptionsCest | ||
{ | ||
use RouterTrait; | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Router\Group :: addOptions() | ||
* | ||
* @param IntegrationTester $I | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
* @author Sid Roberts <[email protected]> | ||
* @since 2019-04-17 | ||
*/ | ||
public function mvcRouterGroupAddOptions(IntegrationTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Router\Group - addOptions()'); | ||
$I->skipTest('Need implementation'); | ||
$I->wantToTest('Mvc\Router - addOptions()'); | ||
|
||
$router = $this->getRouter(false); | ||
|
||
$group = new Group(); | ||
|
||
$group->addOptions( | ||
'/docs/index', | ||
[ | ||
'controller' => 'documentation7', | ||
'action' => 'index', | ||
] | ||
); | ||
|
||
$router->mount($group); | ||
|
||
|
||
|
||
$_SERVER['REQUEST_METHOD'] = 'OPTIONS'; | ||
|
||
$router->handle('/docs/index'); | ||
|
||
|
||
|
||
$I->assertEquals( | ||
'documentation7', | ||
$router->getControllerName() | ||
); | ||
|
||
$I->assertEquals( | ||
'index', | ||
$router->getActionName() | ||
); | ||
|
||
$I->assertEquals( | ||
[], | ||
$router->getParams() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,23 +13,64 @@ | |
namespace Phalcon\Test\Integration\Mvc\Router\Group; | ||
|
||
use IntegrationTester; | ||
use Phalcon\Mvc\Router; | ||
use Phalcon\Mvc\Router\Group; | ||
use Phalcon\Test\Fixtures\Traits\RouterTrait; | ||
|
||
/** | ||
* Class AddPatchCest | ||
*/ | ||
class AddPatchCest | ||
{ | ||
use RouterTrait; | ||
|
||
/** | ||
* Tests Phalcon\Mvc\Router\Group :: addPatch() | ||
* | ||
* @param IntegrationTester $I | ||
* | ||
* @author Phalcon Team <[email protected]> | ||
* @since 2018-11-13 | ||
* @author Sid Roberts <[email protected]> | ||
* @since 2019-04-17 | ||
*/ | ||
public function mvcRouterGroupAddPatch(IntegrationTester $I) | ||
{ | ||
$I->wantToTest('Mvc\Router\Group - addPatch()'); | ||
$I->skipTest('Need implementation'); | ||
$I->wantToTest('Mvc\Router - addPatch()'); | ||
|
||
$router = $this->getRouter(false); | ||
|
||
$group = new Group(); | ||
|
||
$group->addPatch( | ||
'/docs/index', | ||
[ | ||
'controller' => 'documentation4', | ||
'action' => 'index', | ||
] | ||
); | ||
|
||
$router->mount($group); | ||
|
||
|
||
|
||
$_SERVER['REQUEST_METHOD'] = 'PATCH'; | ||
|
||
$router->handle('/docs/index'); | ||
|
||
|
||
|
||
$I->assertEquals( | ||
'documentation4', | ||
$router->getControllerName() | ||
); | ||
|
||
$I->assertEquals( | ||
'index', | ||
$router->getActionName() | ||
); | ||
|
||
$I->assertEquals( | ||
[], | ||
$router->getParams() | ||
); | ||
} | ||
} |
Oops, something went wrong.