public function testCreateTestInvalidActual()
 {
     $newTest = new Test();
     $newTest->setName("Ping 1234")->setExpectation("toPing");
     $this->logIn("ROLE_SUPER_ADMIN");
     $this->makeJsonRequest('POST', '/api/tests/group/' . TestGroupFixtures::$groups['group-2']->getId(), ["name" => $newTest->getName(), "expectation" => $newTest->getExpectation()]);
     $this->assertEquals(Response::HTTP_UNPROCESSABLE_ENTITY, $this->client->getResponse()->getStatusCode());
     $this->assertContains("An actual value to test against must be provided.", $this->getResponseContent(TRUE));
     $this->assertNull($this->em->getRepository("Overwatch\\TestBundle\\Entity\\Test")->findOneBy(["name" => $newTest->getName()]));
 }
Beispiel #2
0
 public function load(ObjectManager $em)
 {
     $test1 = new Test();
     $test1->setName("Group 1, Test 1")->setActual("8.8.8.8")->setExpectation("toPing")->setGroup($this->getReference("group-1"));
     $em->persist($test1);
     $test2 = new Test();
     $test2->setName("Group 1, Test 2")->setActual("8.8.8.9")->setExpectation("toPing")->setGroup($this->getReference("group-1"));
     $em->persist($test2);
     $test3 = new Test();
     $test3->setName("Group 2, Test 3")->setActual("www.google.co.uk")->setExpectation("toPing")->setGroup($this->getReference("group-2"));
     $em->persist($test3);
     $this->addReference('test-1', $test1);
     $this->addReference('test-2', $test2);
     $this->addReference('test-3', $test3);
     $em->flush();
 }
Beispiel #3
0
 private function createTest($name)
 {
     $test = new Test();
     $test->setName($name)->setActual("8.8.8.8")->setExpectation("toPing");
     return $test;
 }