菜谱项目

PersonTest.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Faker\Test\Provider\ja_JP;
  3. use Faker\Generator;
  4. use Faker\Provider\ja_JP\Person;
  5. class PersonTest extends \PHPUnit_Framework_TestCase
  6. {
  7. public function testKanaNameMaleReturns()
  8. {
  9. $faker = new Generator();
  10. $faker->addProvider(new Person($faker));
  11. $faker->seed(1);
  12. $this->assertEquals('アオタ ミノル', $faker->kanaName('male'));
  13. }
  14. public function testKanaNameFemaleReturns()
  15. {
  16. $faker = new Generator();
  17. $faker->addProvider(new Person($faker));
  18. $faker->seed(1);
  19. $this->assertEquals('アオタ ミキ', $faker->kanaName('female'));
  20. }
  21. public function testFirstKanaNameMaleReturns()
  22. {
  23. $faker = new Generator();
  24. $faker->addProvider(new Person($faker));
  25. $faker->seed(1);
  26. $this->assertEquals('ヒデキ', $faker->firstKanaName('male'));
  27. }
  28. public function testFirstKanaNameFemaleReturns()
  29. {
  30. $faker = new Generator();
  31. $faker->addProvider(new Person($faker));
  32. $faker->seed(1);
  33. $this->assertEquals('マアヤ', $faker->firstKanaName('female'));
  34. }
  35. public function testLastKanaNameReturnsNakajima()
  36. {
  37. $faker = new Generator();
  38. $faker->addProvider(new Person($faker));
  39. $faker->seed(1);
  40. $this->assertEquals('ナカジマ', $faker->lastKanaName);
  41. }
  42. }