Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New tests on promos and fix test on exam

  • Loading branch information...
commit 943e86119b2d629d81cffe78a5f92a365bbf769d 1 parent 0104198
@Soulou Soulou authored
View
4 src/Unsapa/IPWBundle/Tests/Entity/ExamTest.php
@@ -40,7 +40,7 @@ public function setUp()
$this->promo = $this->createPromo();
$this->td = $this->createRespTD();
- $this->date = new \DateTime('now');
+ $this->date = (new \DateTime('now'))->add(new \DateInterval("P1D"));
}
/**
@@ -90,7 +90,7 @@ public function testPersistExam()
$this->assertEquals("ExamTest", $exam->getTitle(), "The title is ExamTest");
$this->assertEquals($this->promo, $exam->getPromo(), "The promo is the same");
- $this->assertGreaterThanOrEqual($exam->getExamDate(), (new \Datetime('now')), "The date of the exam is equal or superior of the actual date");
+ $this->assertGreaterThanOrEqual((new \Datetime('now')), $exam->getExamDate(), "The date of the exam is equal or superior of the actual date");
$this->assertEquals($this->date, $exam->getExamDate(), "The initial date and the query result date are identical");
$this->assertEquals("ExamDesc", $exam->getExamDesc(), "Description is equal");
View
19 src/Unsapa/IPWBundle/Tests/Entity/PromoTest.php
@@ -61,4 +61,23 @@ public function testName()
$p->setName("NewNewPromo");
$this->assertEquals("NewNewPromo", $p->getName());
}
+
+ /**
+ * Test two promotion with the same name
+ * @expectedException PDOException
+ */
+ public function testDoubleName()
+ {
+ $this->createPromo("Double");
+ $this->createPromo("Double");
+ }
+
+ /**
+ * Test getId
+ */
+ public function testGetId()
+ {
+ $p = $this->createPromo("TestId");
+ $this->assertTrue(is_integer($p->getId()));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.