commit 2dce1419f12832fd1a8781b2480444c29d238b7c
parent 6dbcb74cfd796a6179ff81c6c7b17d5964e8ea39
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 30 Sep 2015 16:16:37 +0200
Added functional test for syncTips
Diffstat:
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/PartKeepr/TipOfTheDayBundle/Tests/SyncTipsTest.php b/src/PartKeepr/TipOfTheDayBundle/Tests/SyncTipsTest.php
@@ -0,0 +1,23 @@
+<?php
+namespace PartKeepr\TipOfTheDayBundle\Tests;
+
+use Liip\FunctionalTestBundle\Test\WebTestCase;
+
+class SyncTipsTest extends WebTestCase
+{
+ public function setUp()
+ {
+ $this->loadFixtures(array());
+ }
+
+
+ public function testSyncTips () {
+ $this->getContainer()->get("partkeepr.tip_of_the_day_service")->syncTips();
+
+ $dql = "SELECT COUNT(p) FROM PartKeepr\TipOfTheDayBundle\Entity\TipOfTheDay p";
+
+ $query = $this->getContainer()->get("doctrine.orm.entity_manager")->createQuery($dql);
+
+ $this->assertGreaterThan(1, $query->getSingleScalarResult());
+ }
+}
diff --git a/src/PartKeepr/TipOfTheDayBundle/Tests/TipOfTheDayTest.php b/src/PartKeepr/TipOfTheDayBundle/Tests/TipOfTheDayTest.php
@@ -85,7 +85,5 @@ class TipOfTheDayTest extends WebTestCase
$this->assertEquals("hydra:Collection", $response->{"@type"});
$this->assertEquals(0, count($response->{"hydra:member"}));
-
-
}
}