public function testConstructor() { $id = CM_Model_Stream_Subscribe::createStatic(array('user' => CMTest_TH::createUser(), 'start' => time(), 'streamChannel' => CMTest_TH::createStreamChannel(), 'key' => '13215231_1'))->getId(); $streamSubscribe = new CM_Model_Stream_Subscribe($id); $this->assertGreaterThan(0, $streamSubscribe->getId()); try { new CM_Model_Stream_Subscribe(22467); $this->fail('Can instantiate nonexistent VideoStream_Subscribe'); } catch (CM_Exception_Nonexistent $ex) { $this->assertTrue(true); } }
/** * @param CM_Model_Stream_Subscribe $videoStreamSubscribe * @return bool */ public function contains(CM_Model_Stream_Subscribe $videoStreamSubscribe) { return in_array($videoStreamSubscribe->getId(), $this->getItemsRaw()); }