public function updateInstallScripts(Install $originalInstall, Collection $patched, $patchCount) { if ($patchCount >= 0) { $last = $patched->count() - 1; $patched = $patched->getIterator(); /** @var Patch $lastPatch */ $lastPatch = $patched->offsetGet($last); $table = $lastPatch->getTable(); $postPatchInstall = $this->repository->buildInstallFromDatabase($table); $newInstall = $this->factory->createInstall(['table' => $table, 'patch' => $lastPatch->getPatch(), 'install' => $postPatchInstall->getInstall()]); $this->fileMap->updateInstall($originalInstall, $newInstall); } }
/** * @dataProvider thingProvider * @param $patches */ public function testCount($patches) { $collection = new Collection($patches); $this->assertEquals(count($patches), $collection->count()); }