/** * @test */ public function setConfigurationPageThrowsExceptionIfNonExistingPidIsProvided() { $invalidPid = $this->testingFramework->getAutoIncrement('pages'); $this->setExpectedException('InvalidArgumentException', 'The provided UID for the page with the configuration was ' . $invalidPid . ', which was not found to be a UID of an existing page. Please provide the UID of an existing page.'); $_SERVER['argv'][1] = $invalidPid; $this->fixture->setConfigurationPage(); }
/** * @test */ public function loadWithUidOfRecordNotInDatabaseAndDatabaseAccessDisabledMarksModelAsDead() { $uid = $this->testingFramework->getAutoIncrement('tx_oelib_test'); $this->subject->disableDatabaseAccess(); $this->subject->load($this->subject->find($uid)); self::assertTrue($this->subject->find($uid)->isDead()); }
/** * @test */ public function hasAccessForLoggedInUserAndInvalidSeminarUidReturnsWrongSeminarMessage() { $groupUid = $this->testingFramework->createFrontEndUserGroup(array('title' => 'test')); $this->fixture->setConfigurationValue('eventEditorFeGroupID', $groupUid); $this->testingFramework->createAndLoginFrontEndUser($groupUid); $this->fixture->setObjectUid($this->testingFramework->getAutoIncrement('tx_seminars_seminars')); self::assertContains($this->fixture->translate('message_wrongSeminarNumber'), $this->fixture->hasAccessMessage()); }
/** * @test */ public function resetAutoIncrementLazilyCleansUpsAfterOneNewRecordWithThresholdOfOne() { $this->subject->resetAutoIncrement('tx_oelib_test'); $oldAutoIncrement = $this->subject->getAutoIncrement('tx_oelib_test'); $this->subject->setResetAutoIncrementThreshold(1); $latestUid = $this->subject->createRecord('tx_oelib_test'); $this->subject->deleteRecord('tx_oelib_test', $latestUid); $this->subject->resetAutoIncrementLazily('tx_oelib_test'); self::assertSame($oldAutoIncrement, $this->subject->getAutoIncrement('tx_oelib_test')); }
/** * @test */ public function renderNotContainsUidOfRegistrationWithInexistentUser() { $this->registrationFieldKeys = array('uid'); $registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('seminar' => $this->eventUid, 'crdate' => $GLOBALS['SIM_EXEC_TIME'], 'user' => $this->testingFramework->getAutoIncrement('fe_users'))); self::assertNotContains((string) $registrationUid, $this->subject->render()); }
/** * @test */ public function createAndOutputListOfRegistrationsForNonExistingEventUidAddsNotFoundStatusToHeader() { $this->fixture->createAndOutputListOfRegistrations($this->testingFramework->getAutoIncrement('tx_seminars_seminars')); self::assertContains('404', tx_oelib_headerProxyFactory::getInstance()->getHeaderProxy()->getLastAddedHeader()); }