コード例 #1
0
 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));
 }
コード例 #2
0
ファイル: SpeakerTest.php プロジェクト: kurtkk/seminars
 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()));
 }
コード例 #3
0
ファイル: EventTest.php プロジェクト: Konafets/seminars
 /**
  * @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()));
 }
コード例 #4
0
ファイル: RegistrationTest.php プロジェクト: kurtkk/seminars
 /**
  * @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.');
 }
コード例 #5
0
ファイル: AbstractTest.php プロジェクト: kurtkk/seminars
 public function testSaveToDatabaseCanUpdateExistingRecord()
 {
     $this->fixture->saveToDatabase(array('title' => 'new title'));
     self::assertEquals(1, $this->testingFramework->countRecords('tx_seminars_test', 'title = "new title"'));
 }