public function generateFixtureFile($templateName, $templatePath, $fixtureDataPath)
    {
        $fixtures = [];

        for ($i = 0; $i < $this->count; $i++) {
            $fixtures[$templateName . $i] = $this->generateFixture($templatePath . '/' . $templateName . '.php', $i);
        }

        $content = $this->exportFixtures($fixtures);

        // data file full path
        $dataFile = $fixtureDataPath . '/'. $templateName . '.php';

        // data file directory, create if it doesn't exist
        $dataFileDir = dirname($dataFile);
        if (!file_exists($dataFileDir)) {
            FileHelper::createDirectory($dataFileDir);
        }
        file_put_contents($dataFile, $content);
    }
public function generateFixtureFile($templateName, $templatePath, $fixtureDataPath)
    {
        $fixtures = [];

        for ($i = 0; $i < $this->count; $i++) {
            $fixtures[$templateName . $i] = $this->generateFixture($templatePath . '/' . $templateName . '.php', $i);
        }

        $content = $this->exportFixtures($fixtures);

        // data file full path
        $dataFile = $fixtureDataPath . '/'. $templateName . '.php';

        // data file directory, create if it doesn't exist
        $dataFileDir = dirname($dataFile);
        if (!file_exists($dataFileDir)) {
            FileHelper::createDirectory($dataFileDir);
        }
        file_put_contents($dataFile, $content);
    }
public function generateFixtureFile ( $ templateName , $ templatePath , $ fixtureDataPath ) { $ fixtures = [ ] ; for ( $ i = 0 ; $ i < $ this -> count ; $ i ++ ) { $ fixtures [ $ templateName . $ i ] = $ this -> generateFixture ( $ templatePath . '/' . $ templateName . '.php' , $ i ) ; } $ content = $ this -> exportFixtures ( $ fixtures ) ; // data file full path $ dataFile = $ fixtureDataPath . '/' . $ templateName . '.php' ; // data file directory, create if it doesn't exist $ dataFileDir = dirname ( $ dataFile ) ; if ( ! file_exists ( $ dataFileDir ) ) { FileHelper :: createDirectory ( $ dataFileDir ) ; } file_put_contents ( $ dataFile , $ content ) ; }
Generates fixture file by the given fixture template file.
@param string $templateName template file name
@param string $templatePath path where templates are stored
@param string $fixtureDataPath fixture data path where generated file should be written
Generates fixture file by the given fixture template file .