DefaultGeneratorTest.php 710B

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