/** * Test setServiceName and getServiceName methods. */ public function testResourceName() { /** Assert that new object has no Resource name set. */ $this->assertNull($this->_restRoute->getServiceClass(), 'New object has a set Resource name.'); /** Set Resource name. */ $resourceName = 'Resource name'; $this->_restRoute->setServiceClass($resourceName); /** Assert that Resource name was set. */ $this->assertEquals($resourceName, $this->_restRoute->getServiceClass(), 'Resource name is wrong.'); }
/** * @expectedException \Magento\Framework\Webapi\Exception */ public function testNotMatch() { $this->_apiConfigMock->expects($this->once())->method('getRestRoutes')->will($this->returnValue([$this->_routeMock])); $this->_routeMock->expects($this->once())->method('match')->with($this->_request)->will($this->returnValue(false)); $this->_router->match($this->_request); }