public function testReplace() { $filePath = TEST_FILE_FIXTURE_PATH . '/persisting-test.mig'; $unitToReplace = $this->buildUnitOfWork(); $replacementUnit = $this->buildUnitOfWork('replaced!'); $this->repository->add($unitToReplace); $this->repository->persist(); $this->repository->replace($replacementUnit); $this->repository->persist(); static::assertEquals('replaced!', file_get_contents($filePath)); }
public function testReplace() { $unitToReplace = $this->buildUnitOfWork(); $replacementUnit = $this->buildUnitOfWork('replaced!'); $this->repository->add($unitToReplace); $this->repository->persist(); $this->repository->replace($replacementUnit); $this->repository->persist(); $result = $this->connection->query(sprintf('SELECT * FROM %s', $this->tableName)); static::assertEquals($this->uidValue, $result[0]['unique_id']); static::assertEquals('replaced!', $result[0]['query']); }