-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#12 SiwappBaseTest test class to be inherited.
also, sqlite db for testing purpses (more speed)
- Loading branch information
Showing
3 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
|
||
class SiwappBaseTest extends PHPUnit_Framework_TestCase | ||
{ | ||
protected $_application; | ||
|
||
public function setUp() | ||
{ | ||
$kernel = new \AppKernel("test", true); | ||
$kernel->boot(); | ||
$this->_application = new Application($kernel); | ||
$this->_application->setAutoExit(false); | ||
$this->runConsole("doctrine:schema:drop", array("--force" => true)); | ||
$this->runConsole("doctrine:schema:create"); | ||
$this->runConsole("cache:warmup"); | ||
$this->runConsole("doctrine:fixtures:load", array("--fixtures" => __DIR__ . "/../DataFixtures")); | ||
} | ||
|
||
protected function runConsole($command, Array $options = array()) | ||
{ | ||
$options["-e"] = "test"; | ||
$options["-q"] = null; | ||
$options = array_merge($options, array('command' => $command)); | ||
return $this->_application->run(new \Symfony\Component\Console\Input\ArrayInput($options)); | ||
} | ||
|
||
public function testDummy() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
<?php | ||
|
||
use Siwapp\InvoiceBundle\Entity\Invoice; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
|
||
class InvoiceTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testTrial() | ||
{ | ||
$inv = new Invoice(); | ||
$this->assertEquals(0,0); | ||
} | ||
public function testTrial() | ||
{ | ||
$inv = new Invoice(); | ||
$this->assertEquals(0,0); | ||
} | ||
} |