public function testAddCategoryRelationCreatesRelations() { self::assertEquals(0, $this->testingFramework->countRecords('tx_seminars_seminars_categories_mm', 'uid_local=' . $this->seminarUid)); $this->addCategoryRelation(array()); self::assertEquals(1, $this->testingFramework->countRecords('tx_seminars_seminars_categories_mm', 'uid_local=' . $this->seminarUid)); $this->addCategoryRelation(array()); self::assertEquals(2, $this->testingFramework->countRecords('tx_seminars_seminars_categories_mm', 'uid_local=' . $this->seminarUid)); }
public function testAddSkillRelationCreatesRelations() { self::assertEquals(0, $this->testingFramework->countRecords('tx_seminars_speakers_skills_mm', 'uid_local=' . $this->fixture->getUid())); $this->addSkillRelation(array()); self::assertEquals(1, $this->testingFramework->countRecords('tx_seminars_speakers_skills_mm', 'uid_local=' . $this->fixture->getUid())); $this->addSkillRelation(array()); self::assertEquals(2, $this->testingFramework->countRecords('tx_seminars_speakers_skills_mm', 'uid_local=' . $this->fixture->getUid())); }
/** * @test */ public function addLeaderRelationCreatesRelations() { self::assertSame(0, $this->testingFramework->countRecords('tx_seminars_seminars_speakers_mm_leaders', 'uid_local=' . $this->fixture->getUid())); $this->addLeaderRelation(array()); self::assertSame(1, $this->testingFramework->countRecords('tx_seminars_seminars_speakers_mm_leaders', 'uid_local=' . $this->fixture->getUid())); $this->addLeaderRelation(array()); self::assertSame(2, $this->testingFramework->countRecords('tx_seminars_seminars_speakers_mm_leaders', 'uid_local=' . $this->fixture->getUid())); }
/** * @test */ public function commitToDbCanCreateCheckboxesRelation() { $seminar = new tx_seminars_seminar($this->seminarUid); $checkboxesUid = $this->testingFramework->createRecord('tx_seminars_checkboxes'); $registration = new tx_seminars_registrationchild(0); $registration->setRegistrationData($seminar, 0, array('checkboxes' => array($checkboxesUid))); $registration->enableTestMode(); $this->testingFramework->markTableAsDirty('tx_seminars_attendances'); $this->testingFramework->markTableAsDirty('tx_seminars_attendances_checkboxes_mm'); self::assertTrue($registration->isOk()); self::assertTrue($registration->commitToDb()); self::assertSame(1, $this->testingFramework->countRecords('tx_seminars_attendances', 'uid=' . $registration->getUid()), 'The registration record cannot be found in the DB.'); self::assertSame(1, $this->testingFramework->countRecords('tx_seminars_attendances_checkboxes_mm', 'uid_local=' . $registration->getUid() . ' AND uid_foreign=' . $checkboxesUid), 'The relation record cannot be found in the DB.'); }
public function testSaveToDatabaseCanUpdateExistingRecord() { $this->fixture->saveToDatabase(array('title' => 'new title')); self::assertEquals(1, $this->testingFramework->countRecords('tx_seminars_test', 'title = "new title"')); }