Esempio n. 1
0
 public function testLocalRecordReference()
 {
     $l = new LocalRecord();
     $c = new CopyRecord();
     $this->assertNull($c->getLocalRecord());
     $l->addCopyRecord($c);
     $this->assertSame($l, $c->getLocalRecord());
     $c->unsetLocalRecord();
     $this->assertNull($c->getLocalRecord());
     $this->assertFalse($l->containsCopyRecord($c));
 }
Esempio n. 2
0
 /**
  * Set the containing local record.
  *
  * @param  LocalRecord $record Local record
  * @return void
  */
 public function setLocalRecord(LocalRecord $record)
 {
     $this->unsetLocalRecord();
     if (!$record->containsCopyRecord($this)) {
         $record->addCopyRecord($this);
     }
     $this->_parent = $record;
 }
Esempio n. 3
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testAddCopyRecordThrowsExceptionOnDuplicateCopyRecord()
 {
     $r = new LocalRecord();
     $c = new CopyRecord();
     $r->addCopyRecord($c);
     $r->addCopyRecord($c);
 }