public function testGetByIDWithResourceNotFound() { //TokenResponseException $request = $this->getMockBuilder('\\Kanedo\\Request')->disableOriginalConstructor()->getMock(); $request->expects($this->any())->method('request')->will($this->throwException(new \OAuth\Common\Http\Exception\TokenResponseException("Resouce not found", 404))); $bookmarks = new Bookmarks($request); $this->assertFalse($bookmarks->getByID(1), 'Test if Bookmarks returns false if Resource is not found'); }