public function testAssignActionAddPerson()
 {
     $document = $this->createTestDocument();
     $this->documentId = $document->store();
     $this->getRequest()->setMethod('POST')->setPost(array('LastName' => 'Testy-AssignAction', 'Document' => array('Role' => 'translator'), 'Save' => 'Speichern'));
     $this->dispatch('/admin/person/assign/document/' . $this->documentId . '/role/translator');
     $location = $this->getLocation();
     $matches = array();
     preg_match('/person\\/(\\d+)\\//', $location, $matches);
     $personId = $matches[1];
     $person = new Opus_Person($personId);
     $lastName = $person->getLastName();
     $person->delete();
     $this->assertTrue(strpos($location, '/admin/document/edit/id/' . $this->documentId . '/continue/addperson') === 0);
     $this->assertEquals('Testy-AssignAction', $lastName);
 }
示例#2
0
 public function tearDown()
 {
     $person = new Opus_Person($this->author1Id);
     $person->delete();
     $person = new Opus_Person($this->author2Id);
     $person->delete();
     $person = new Opus_Person($this->author3Id);
     $person->delete();
     $person = new Opus_Person($this->author4Id);
     $person->delete();
     parent::tearDown();
 }
 protected function tearDown()
 {
     $person = new Opus_Person($this->authorId);
     $person->delete();
     parent::tearDown();
 }