Eris\Generator\AssociativeArrayGeneratorTest::testShrinksTheGeneratorsButKeepsAllTheKeysPresent PHP Method

testShrinksTheGeneratorsButKeepsAllTheKeysPresent() public method

    public function testShrinksTheGeneratorsButKeepsAllTheKeysPresent()
    {
        $generator = new AssociativeArrayGenerator(['former' => $this->smallIntegerGenerator, 'latter' => $this->smallIntegerGenerator]);
        $value = $generator($this->size, $this->rand);
        for ($i = 0; $i < 100; $i++) {
            $value = $generator->shrink($value);
            $array = $value->unbox();
            $this->assertEquals(2, count($array));
            $this->assertEquals(['former', 'latter'], array_keys($array));
            $this->assertInternalType('integer', $array['former']);
            $this->assertInternalType('integer', $array['latter']);
        }
    }