ControllerProviderTest::createApplication PHP Method

createApplication() public method

public createApplication ( )
    public function createApplication()
    {
        $app = TestDBSetup::createAppAndDB();
        $app->register(new Silex\Provider\SessionServiceProvider());
        $app['session.test'] = true;
        $app['debug'] = true;
        $this->fileProcessorHandle = Phony::mock('\\CRUDlex\\SimpleFilesystemFileProcessor');
        $this->fileProcessorHandle->renderFile->returns('rendered file');
        $fileProcessorMock = $this->fileProcessorHandle->get();
        $dataFactory = new CRUDlex\MySQLDataFactory($app['db']);
        $app->register(new CRUDlex\ServiceProvider(), ['crud.file' => __DIR__ . '/../crud.yml', 'crud.datafactory' => $dataFactory, 'crud.fileprocessor' => $fileProcessorMock]);
        $app->register(new Silex\Provider\TwigServiceProvider(), ['twig.path' => __DIR__ . '/../views']);
        $app->mount('/crud', new CRUDlex\ControllerProvider());
        $this->dataBook = $app['crud']->getData('book');
        $this->dataLibrary = $app['crud']->getData('library');
        return $app;
    }