diff --git a/composer.json b/composer.json index adfeed6..dcb639b 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,6 @@ "knplabs/console-service-provider": "dev-master" }, "autoload": { - "psr-0": { "Poche": "src/" } + "psr-0": { "Poche\\": "src/" } } } diff --git a/src/Poche/Command/UnitTestsCommand.php b/src/Poche/Command/UnitTestsCommand.php index 81fa809..f6f20e5 100644 --- a/src/Poche/Command/UnitTestsCommand.php +++ b/src/Poche/Command/UnitTestsCommand.php @@ -26,8 +26,9 @@ class UnitTestsCommand extends BaseCommand { $atoum = $this->getProjectDirectory().'/vendor/bin/atoum'; $unitTests = $this->getProjectDirectory().'/tests'; + $bootstrapFile = $this->getProjectDirectory().'/tests/bootstrap.php'; - passthru(sprintf('%s -d %s -ft', $atoum, $unitTests), $status); + passthru(sprintf('%s -d %s -bf %s -ft', $atoum, $unitTests, $bootstrapFile), $status); return $status; } diff --git a/src/Poche/Model/Entry.php b/src/Poche/Model/Entry.php new file mode 100644 index 0000000..6e5f950 --- /dev/null +++ b/src/Poche/Model/Entry.php @@ -0,0 +1,16 @@ +id = $id; + $this->title = $title; + } + + public function getId() { + return $this->id; + } + +} diff --git a/src/controllers.php b/src/controllers.php index 04e9378..410f9b7 100644 --- a/src/controllers.php +++ b/src/controllers.php @@ -1,5 +1,9 @@ get('/', function () use ($app) { - return $app['twig']->render('index.twig'); + + $entry = new Entry(1, "Titre de test"); + + return $app['twig']->render('index.twig', array('entry' => $entry)); }); diff --git a/src/views/index.twig b/src/views/index.twig index 0b0e0df..d7b17aa 100644 --- a/src/views/index.twig +++ b/src/views/index.twig @@ -1 +1,2 @@ -Poche v2 +Poche v2
+{{ entry.id }} - {{ entry.title }} diff --git a/tests/unit/Entry.php b/tests/unit/Entry.php new file mode 100644 index 0000000..329b3b7 --- /dev/null +++ b/tests/unit/Entry.php @@ -0,0 +1,18 @@ +integer($entry->getId()) + ->isEqualTo('Test') + ; + } +}