Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions tests/Zend/Rest/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function test_getInstance_fromINIConfig()
$router = new RewriteRouter();
$router->addConfig($config, 'routes');
$route = $router->getRoute('rest');
$this->assertType('Zend\\Rest\\Route', $route);
$this->assertInstanceOf('Zend\\Rest\\Route', $route);
$this->assertEquals('object', $route->getDefault('controller'));

$request = $this->_buildRequest('GET', '/mod/project');
Expand All @@ -105,7 +105,9 @@ public function test_RESTfulApp_defaults()
$request = $this->_buildRequest('GET', '/');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
// $this->assertInternalType('array', $values);
$this->assertInternalType('array', $values);

$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('index', $values['controller']);
Expand All @@ -120,7 +122,7 @@ public function test_RESTfulApp_GET_user_defaults()
$request = $this->_buildRequest('GET', '/user');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -132,7 +134,7 @@ public function test_RESTfulApp_GET_user_index()
$request = $this->_buildRequest('GET', '/user/index');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -144,7 +146,7 @@ public function test_RESTfulApp_GET_user_index_withParams()
$request = $this->_buildRequest('GET', '/user/index/changedSince/123456789/status/active');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -158,7 +160,7 @@ public function test_RESTfulApp_GET_user_index_withQueryParams()
$request = $this->_buildRequest('GET', '/user/?changedSince=123456789&status=active');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -172,7 +174,7 @@ public function test_RESTfulApp_GET_project_byIdentifier()
$request = $this->_buildRequest('GET', '/project/zendframework');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('project', $values['controller']);
Expand All @@ -185,7 +187,7 @@ public function test_RESTfulApp_GET_project_byIdQueryParam()
$request = $this->_buildRequest('GET', '/project/?id=zendframework');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('project', $values['controller']);
Expand All @@ -198,7 +200,7 @@ public function test_RESTfulApp_GET_project_byIdentifier_urlencoded()
$request = $this->_buildRequest('GET', '/project/zend+framework');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('project', $values['controller']);
Expand All @@ -211,7 +213,7 @@ public function test_RESTfulApp_GET_project_edit()
$request = $this->_buildRequest('GET', '/project/zendframework/edit');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('default', $values['module']);
$this->assertEquals('project', $values['controller']);
Expand All @@ -224,7 +226,7 @@ public function test_RESTfulApp_PUT_user_byIdentifier()
$request = $this->_buildRequest('PUT', '/mod/user/lcrouch');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -237,7 +239,7 @@ public function test_RESTfulApp_POST_user()
$request = $this->_buildRequest('POST', '/mod/user');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -249,7 +251,7 @@ public function test_RESTfulApp_DELETE_user_byIdentifier()
$request = $this->_buildRequest('DELETE', '/mod/user/lcrouch');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -262,7 +264,7 @@ public function test_RESTfulApp_POST_user_with_identifier_doesPUT()
$request = $this->_buildRequest('POST', '/mod/user/lcrouch');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -276,7 +278,7 @@ public function test_RESTfulApp_overload_POST_with_method_param_PUT()
$request->setParam('_method', 'PUT');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -289,7 +291,7 @@ public function test_RESTfulApp_overload_POST_with_http_header_DELETE()
$request->setHeader('X-HTTP-Method-Override', 'DELETE');
$values = $this->_invokeRouteMatch($request);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand Down Expand Up @@ -323,7 +325,7 @@ public function test_RESTfulModule_GET_user_index()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -336,7 +338,7 @@ public function test_RESTfulModule_GET_user()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -349,7 +351,7 @@ public function test_RESTfulModule_POST_user()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -371,7 +373,7 @@ public function test_RESTfulModule_PUT_user_byIdentifier()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -385,7 +387,7 @@ public function test_RESTfulModule_DELETE_user_byIdentifier()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -399,7 +401,7 @@ public function test_RESTfulController_GET_user_index()
$config = array('mod'=>array('user'));
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand Down Expand Up @@ -430,7 +432,7 @@ public function test_RESTfulController_GET_user()
$config = array('mod'=>array('user'));
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -443,7 +445,7 @@ public function test_RESTfulController_POST_user()
$config = array('mod'=>array('user'));
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand Down Expand Up @@ -483,7 +485,7 @@ public function test_RESTfulController_PUT_user_byIdentifier()
$config = array('mod'=>array('user'));
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand All @@ -497,7 +499,7 @@ public function test_RESTfulController_DELETE_user_byIdentifier()
$config = array('mod');
$values = $this->_invokeRouteMatch($request, $config);

$this->assertType('array', $values);
$this->assertInternalType('array', $values);
$this->assertTrue(isset($values['module']));
$this->assertEquals('mod', $values['module']);
$this->assertEquals('user', $values['controller']);
Expand Down