コード例 #1
0
 public function testDispatchRepositoryCounts()
 {
     $this->sourceRepository->add($this->buildUnitOfWork());
     static::assertEquals(1, $this->sourceRepository->count());
     static::assertEquals(0, $this->historyRepository->count());
     $this->manager->dispatch();
     static::assertEquals(1, $this->sourceRepository->count());
     static::assertEquals(1, $this->historyRepository->count());
 }
コード例 #2
0
 public function testPersistingProducesNoDuplicates()
 {
     $unitOfWorkToPersist = $this->buildUnitOfWork();
     $this->repository->add($unitOfWorkToPersist);
     $firstPersistingWasSuccessful = $this->repository->persist();
     static::assertTrue($firstPersistingWasSuccessful);
     $secondPersistingWasSuccessful = $this->repository->persist();
     static::assertTrue($secondPersistingWasSuccessful);
     $dbCount = $this->connection->query(sprintf('SELECT count(unique_id) AS cnt FROM %s', $this->tableName));
     static::assertEquals((int) $dbCount[0]['cnt'], $this->repository->count());
 }
コード例 #3
0
ファイル: MemoryTest.php プロジェクト: bytepark/lib-migration
 public function testInitialMemoryRepositoryIsEmpty()
 {
     static::assertEquals(0, $this->repository->count());
 }
コード例 #4
0
ファイル: FlatTest.php プロジェクト: bytepark/lib-migration
 public function testFilesAreLoadedOnConstruction()
 {
     static::assertEquals(count(glob(TEST_FILE_FIXTURE_PATH . '/*.mig')), $this->repository->count());
 }
コード例 #5
0
 public function testFilesAreLoadedOnConstruction()
 {
     static::assertEquals(count($this->source), $this->repository->count());
 }