Пример #1
0
 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()]));
 }