public function testDisplayCollectionNumberAndNameOnAssignmentPageForDDCCollection() { $this->markTestIncomplete("Muss fuer OPUS 4.4 angepasst werden."); // TODO OPUSVIER-2794 $role = new Opus_CollectionRole(2); $displayBrowsing = $role->getDisplayBrowsing(); $role->setDisplayBrowsing('Name'); $role->store(); $this->dispatch('/admin/document/edit/id/89/section/collections'); // undo changes $role->setDisplayBrowsing($displayBrowsing); $role->store(); $this->assertContains('62 Ingenieurwissenschaften', $this->getResponse()->getBody()); $this->assertNotContains('Ingenieurwissenschaften 62', $this->getResponse()->getBody()); }
public function testCreateActionForEdit() { $this->useEnglish(); $roles = Opus_CollectionRole::fetchAll(); $role = new Opus_CollectionRole(); $role->setName('EditTestName'); $role->setOaiName('EditTestOaiName'); $role->setDisplayBrowsing('Name'); $role->setDisplayFrontdoor('Number'); $role->setVisible(1); $role->setVisibleBrowsingStart(1); $role->setVisibleFrontdoor(0); $role->setVisibleOai(0); $role->setPosition(20); $roleId = $role->store(); $post = array('oid' => $roleId, 'Name' => 'ModifiedName', 'OaiName' => 'ModifiedOaiName', 'DisplayBrowsing' => 'Number,Name', 'DisplayFrontdoor' => 'Name,Number', 'Visible' => '0', 'VisibleBrowsingStart' => '0', 'VisibleFrontdoor' => '1', 'VisibleOai' => '1', 'Position' => '19', 'Save' => 'Speichern'); $this->getRequest()->setMethod('POST')->setPost($post); $this->dispatch('/admin/collectionroles/create'); $this->assertEquals(count($roles) + 1, count(Opus_CollectionRole::fetchAll())); // keine neue Collection $role = new Opus_CollectionRole($roleId); $role->delete(); $this->assertEquals('ModifiedName', $role->getName()); $this->assertEquals('ModifiedOaiName', $role->getOaiName()); $this->assertEquals('Number,Name', $role->getDisplayBrowsing()); $this->assertEquals('Name,Number', $role->getDisplayFrontdoor()); $this->assertEquals(0, $role->getVisible()); $this->assertEquals(0, $role->getVisibleBrowsingStart()); $this->assertEquals(1, $role->getVisibleFrontdoor()); $this->assertEquals(1, $role->getVisibleOai()); $this->assertEquals(19, $role->getPosition()); $this->assertRedirectTo('/admin/collectionroles'); $this->verifyFlashMessage('Collection role \'ModifiedName\' was edited successfully.', self::MESSAGE_LEVEL_NOTICE); }
public function testShowAllDocsForBklCollection() { $role = new Opus_CollectionRole(7); $displayBrowsing = $role->getDisplayBrowsing(); $role->setDisplayBrowsing('Name'); $role->store(); $this->dispatch('/admin/documents/index/collectionid/15028'); // undo changes $role->setDisplayBrowsing($displayBrowsing); $role->store(); $this->assertContains('<b>52.00 Maschinenbau, Energietechnik, Fertigungstechnik: Allgemeines</b>', $this->getResponse()->getBody()); $this->assertNotContains('<b>Maschinenbau, Energietechnik, Fertigungstechnik: Allgemeines</b>', $this->getResponse()->getBody()); }