/** * Test setResourceType and getResourceType methods. */ public function testResourceType() { /** Assert new object has no Resource type set. */ $this->assertNull($this->_restRoute->getResourceType(), 'New object has an set Resource type.'); /** Set Resource type. */ $resourceType = 'Resource type'; $this->_restRoute->setResourceType($resourceType); /** Assert Resource type was set. */ $this->assertEquals($resourceType, $this->_restRoute->getResourceType(), 'Resource type is wrong.'); }
public function testCheckRouteException() { /** Prepare mocks for SUT constructor. */ $checkRouteData = $this->_prepareMockDataForCheckRouteTest(); $this->_routeMock->expects($this->once())->method('match')->with($checkRouteData['request'])->will($this->returnValue(false)); $this->setExpectedException('Mage_Webapi_Exception', 'Request does not match any route.', Mage_Webapi_Exception::HTTP_NOT_FOUND); /** Execute SUT. */ $this->_router->checkRoute($checkRouteData['request'], $checkRouteData['methodName'], $checkRouteData['version']); }