/** * {@inheritdoc} */ protected function assertSystem(Model $case) { $this->assertSame('CaseModel', $case->getStructure()->getName()); $this->assertSame('Welcome', $case->get('subject')); $this->assertSame(5, $case->get('priority')); $this->assertSame('new', $case->get('status')); $this->assertSame(array('Spam', 'Test'), $case->get('labels')); $this->assertInstanceOf('DateTime', $case->get('created_at')); $this->assertSame(1335994728, $case->get('created_at')->getTimestamp()); $this->assertInstanceOf('DateTime', $case->get('updated_at')); $this->assertSame(1335994728, $case->get('updated_at')->getTimestamp()); $this->assertInstanceOf('DateTime', $case->get('received_at')); $this->assertSame(1335994728, $case->get('received_at')->getTimestamp()); $caseHistory = $case->getLink('history'); $this->assertInstanceOf('Guzzle\\Service\\Command\\OperationCommand', $caseHistory); $this->assertSame('ListCaseHistory', $caseHistory->getName()); $this->assertSame(1, $caseHistory->get('case_id')); }
/** * @covers Desk\Relationship\Resource\Model::getLink * @expectedException Desk\Relationship\Exception\UnknownResourceException * @expectedExceptionMessage No related resource named 'baz' */ public function testGetLinkInvalid() { $links = array('foo' => 'bar'); $model = new Model(array('_links' => $links)); $link = $model->getLink('baz'); }