Neos\Flow\Tests\Functional\Validation\ValidationTest::validationIsEnforcedOnSuccessiveRequests PHP Method

validationIsEnforcedOnSuccessiveRequests() public method

The ValidationResolver has a 1st level cache. This test ensures that this cache is flushed between two requests.
    public function validationIsEnforcedOnSuccessiveRequests()
    {
        $entity = new TestEntity();
        $entity->setName('Some Name');
        $this->testEntityRepository->add($entity);
        $this->persistenceManager->persistAll();
        $this->persistenceManager->clearState();
        $entityIdentifier = $this->persistenceManager->getIdentifierByObject($entity);
        $validArguments = ['entity' => ['__identity' => $entityIdentifier, 'name' => 'long enough name']];
        $response = $this->browser->request('http://localhost/test/validation/entity/update', 'POST', $validArguments);
        $this->assertSame('Entity "long enough name" updated', $response->getContent());
        $invalidArguments = ['entity' => ['__identity' => $entityIdentifier, 'name' => 'xx']];
        $response = $this->browser->request('http://localhost/test/validation/entity/update', 'POST', $invalidArguments);
        $this->assertSame('An error occurred while trying to call Neos\\Flow\\Tests\\Functional\\Mvc\\Fixtures\\Controller\\EntityController->updateAction().' . PHP_EOL . 'Error for entity.name:  This field must contain at least 3 characters.' . PHP_EOL, $response->getContent());
    }