public function actionUnload(array $fixturesInput = [])
{
$filtered = $this->filterFixtures($fixturesInput);
$except = $filtered['except'];
if (!$this->needToApplyAll($fixturesInput[0])) {
$fixtures = $filtered['apply'];
$foundFixtures = $this->findFixtures($fixtures);
$notFoundFixtures = array_diff($fixtures, $foundFixtures);
if ($notFoundFixtures) {
$this->notifyNotFound($notFoundFixtures);
}
} else {
$foundFixtures = $this->findFixtures();
}
$fixturesToUnload = array_diff($foundFixtures, $except);
if (!$foundFixtures) {
throw new Exception("No files were found for: \"" . implode(', ', $fixturesInput) . "\".\n" . "Check that files exist under fixtures path: \n\"" . $this->getFixturePath() . "\".");
}
if (!$fixturesToUnload) {
$this->notifyNothingToUnload($foundFixtures, $except);
return static::EXIT_CODE_NORMAL;
}
if (!$this->confirmUnload($fixturesToUnload, $except)) {
return static::EXIT_CODE_NORMAL;
}
$fixtures = $this->getFixturesConfig(array_merge($this->globalFixtures, $fixturesToUnload));
if (!$fixtures) {
throw new Exception('No fixtures were found in namespace: ' . $this->namespace . '".');
}
$this->unloadFixtures($this->createFixtures($fixtures));
$this->notifyUnloaded($fixtures);
}