/** * @test */ public function saveForModelWithBidirectionalMNRelationCreatesIntermediateRelationRecordAndIncrementsSorting() { $parentUid1 = $this->testingFramework->createRecord('tx_oelib_test'); $parentUid2 = $this->testingFramework->createRecord('tx_oelib_test'); $childUid = $this->testingFramework->createRecord('tx_oelib_test'); $parent1 = $this->subject->find($parentUid1); $parent2 = $this->subject->find($parentUid2); /** @var Tx_Oelib_Tests_Unit_Fixtures_TestingModel $child */ $child = $this->subject->find($childUid); $child->getBidirectional()->add($parent1); $child->getBidirectional()->add($parent2); $this->subject->save($child); self::assertTrue($this->testingFramework->existsRecord('tx_oelib_test_article_mm', 'uid_local=' . $parentUid2 . ' AND uid_foreign=' . $childUid . ' AND sorting=1')); }
/** * @test */ public function sendCancellationDeadlineRemindersSetsFlagInTheDatabaseWhenReminderWasSent() { $this->addSpeaker($this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_PLANNED))); $this->fixture->sendCancellationDeadlineReminders(); self::assertTrue($this->testingFramework->existsRecord('tx_seminars_seminars', 'cancelation_deadline_reminder_sent = 1')); }
/** * @test */ public function insertInsertsRecord() { Tx_Oelib_Db::insert('tx_oelib_test', array('title' => 'foo', 'is_dummy_record' => 1)); $this->testingFramework->markTableAsDirty('tx_oelib_test'); self::assertTrue($this->testingFramework->existsRecord('tx_oelib_test', 'title = "foo"')); }
/** * @test */ public function createBackEndUserGroupForTitleGivenStoresTitleInGroupRecord() { $this->subject->createBackEndUserGroup(array('title' => 'foo group')); self::assertTrue($this->subject->existsRecord('be_groups', 'title = "foo group"')); }