Faker\Test\Provider\BaseTest::testOptionalAllowsChainingPropertyAccess PHP Méthode

testOptionalAllowsChainingPropertyAccess() public méthode

    public function testOptionalAllowsChainingPropertyAccess()
    {
        $faker = new \Faker\Generator();
        $faker->addProvider(new \Faker\Provider\Base($faker));
        $faker->addProvider(new \ArrayObject(array(1)));
        // hack because method_exists forbids stubs
        $this->assertEquals(1, $faker->optional(100)->count);
        $this->assertNull($faker->optional(0)->count);
    }
BaseTest