/** * @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.'); }