Nelmio\Alice\Loader\LoaderIntegrationTest::testUniqueValueGenerationFailure PHP Метод

testUniqueValueGenerationFailure() публичный Метод

    public function testUniqueValueGenerationFailure()
    {
        $data = [\stdClass::class => ['dummy{1..10}' => ['number (unique)' => '<numberBetween(1, 2)>']]];
        try {
            $this->loader->loadData($data);
            $this->fail('Expected exception to be thrown.');
        } catch (UnresolvableValueDuringGenerationException $exception) {
            $previous = $exception->getPrevious();
            $this->assertInstanceOf(UniqueValueGenerationLimitReachedException::class, $previous);
            $this->assertTrue(1 === preg_match('/^Could not generate a unique value after 150 attempts for ".*"\\.$/', $previous->getMessage()));
        }
    }