public function testSeriesVisibility() { $series = new Opus_Series(1); $this->assertEquals($series->getVisible(), '1'); $series = new Opus_Series(2); $this->assertEquals($series->getVisible(), '1'); $series = new Opus_Series(3); $this->assertEquals($series->getVisible(), '1'); $series = new Opus_Series(4); $this->assertEquals($series->getVisible(), '1'); }
public function __construct($seriesId) { if (is_null($seriesId)) { throw new Solrsearch_Model_Exception('Could not browse series due to missing id parameter.'); } $s = null; try { $s = new Opus_Series($seriesId); } catch (Opus_Model_NotFoundException $e) { throw new Solrsearch_Model_Exception("Series with id '" . $seriesId . "' does not exist."); } if ($s->getVisible() !== '1') { throw new Solrsearch_Model_Exception("Series with id '" . $seriesId . "' is not visible."); } if ($s->getNumOfAssociatedPublishedDocuments() === 0) { throw new Solrsearch_Model_Exception("Series with id '" . $seriesId . "' does not have any published documents."); } $this->_series = $s; }
public function testEditActionSave() { $this->createsModels = true; $seriesId = $this->createNewModel(); $this->getRequest()->setMethod('POST')->setPost(array('Id' => $seriesId, 'Title' => 'ModifiedTitle', 'Infobox' => 'ModifiedInfo', 'Visible' => '0', 'SortOrder' => '12', 'Save' => 'Abspeichern')); $this->dispatch('/admin/series/edit'); $this->assertRedirectTo('/admin/series/show/id/' . $seriesId); $this->verifyFlashMessage('controller_crud_save_success', self::MESSAGE_LEVEL_NOTICE); $series = new Opus_Series($seriesId); $this->assertEquals('ModifiedTitle', $series->getTitle()); $this->assertEquals('ModifiedInfo', $series->getInfobox()); $this->assertEquals(0, $series->getVisible()); $this->assertEquals(12, $series->getSortOrder()); }