DefaultGeneratorTest.php 711 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Faker\Test;
  3. use Faker\DefaultGenerator;
  4. use PHPUnit\Framework\TestCase;
  5. class DefaultGeneratorTest extends TestCase
  6. {
  7. public function testGeneratorReturnsNullByDefault()
  8. {
  9. $generator = new DefaultGenerator;
  10. $this->assertNull($generator->value);
  11. }
  12. public function testGeneratorReturnsDefaultValueForAnyPropertyGet()
  13. {
  14. $generator = new DefaultGenerator(123);
  15. $this->assertSame(123, $generator->foo);
  16. $this->assertNotNull($generator->bar);
  17. }
  18. public function testGeneratorReturnsDefaultValueForAnyMethodCall()
  19. {
  20. $generator = new DefaultGenerator(123);
  21. $this->assertSame(123, $generator->foobar());
  22. }
  23. }