Skip to content

Commit

Permalink
use cmf shell scritps to initialize database
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian committed Dec 22, 2014
1 parent 623798d commit def6d54
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Tests/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,21 @@ class BaseTestCase extends CmfBaseTestCase

public function setUp()
{

$this->client = $this->createClient($this->getKernelConfiguration());

$this->application = new Application($this->client->getKernel());
$this->application->setAutoExit(false);

$this->router = $this->client->getContainer()->get('router');
$this->router = $this->get('router');

$this->runConsole('doctrine:database:drop', array('--force' => true));
$this->runConsole('doctrine:database:create');
// $this->db('PHPCR')->loadFixtures(array(
// 'Symfony\Cmf\Bundle\BlogBundle\Tests\Resources\DataFixtures\PHPCR\LoadBlogData',
// ));

$this->runConsole('doctrine:phpcr:init:dbal');
$this->runConsole('doctrine:phpcr:repo:init');
$this->runConsole('doctrine:phpcr:fixtures:load', array(
'--fixtures' => __DIR__.'/../Resources/DataFixtures/PHPCR',
'--no-interaction' => true,
));

}

/**
Expand Down
1 change: 1 addition & 0 deletions Tests/Resources/app/config/blogbundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ parameters:
phpcr_basepath: /cms

doctrine:
orm: ~
dbal:
driver: pdo_sqlite
path: %kernel.root_dir%/../test_db.sqlite
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"phpunit/phpunit": "~3.7.28",
"symfony-cmf/testing": "1.2.*",
"sonata-project/doctrine-phpcr-admin-bundle": "1.2.*",
"doctrine/orm": "~2.4.7",
"nelmio/alice": "~1.7.2"
},
"suggest": {
Expand Down
5 changes: 5 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
sh vendor/symfony-cmf/testing/bin/travis/doctrine_orm.sh
sh vendor/symfony-cmf/testing/bin/travis/phpcr_odm_doctrine_dbal.sh
bin/phpunit

0 comments on commit def6d54

Please sign in to comment.