Eris\Generator\AssociativeArrayGeneratorTest::testConstructWithAnAssociativeArrayOfGenerators PHP Method

testConstructWithAnAssociativeArrayOfGenerators() public method

    public function testConstructWithAnAssociativeArrayOfGenerators()
    {
        $generator = new AssociativeArrayGenerator(['letter' => $this->letterGenerator, 'cipher' => $this->cipherGenerator]);
        $generated = $generator($this->size, $this->rand);
        $this->assertTrue($generator->contains($generated));
        $array = $generated->unbox();
        $this->assertEquals(2, count($array));
        $letter = $array['letter'];
        $this->assertInternalType('string', $letter);
        $this->assertEquals(1, strlen($letter));
        $cipher = $array['cipher'];
        $this->assertInternalType('integer', $cipher);
        $this->assertGreaterThanOrEqual(0, $cipher);
        $this->assertLessThanOrEqual(9, $cipher);
        $this->assertSame(2, count($generated->unbox()));
    }