forked from fzaninotto/Faker
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Do not use
static
in callables (#785)
* Fix: Add tests * Fix: Do not use static in callables
- Loading branch information
1 parent
2040bda
commit 8d32135
Showing
3 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Faker\Test\Provider\pt_BR; | ||
|
||
use Faker\Provider; | ||
use Faker\Test; | ||
|
||
/** | ||
* @covers \Faker\Provider\pt_BR\PhoneNumber | ||
*/ | ||
final class PhoneNumberTest extends Test\TestCase | ||
{ | ||
public function testPhoneReturnsPhoneNumberWhenArgumentIsFalse(): void | ||
{ | ||
$phoneNumber = $this->faker->phone(false); | ||
|
||
self::assertIsString($phoneNumber); | ||
self::assertNotEmpty($phoneNumber); | ||
} | ||
|
||
public function testPhoneReturnsPhoneNumberWhenArgumentIsTrue(): void | ||
{ | ||
$phoneNumber = $this->faker->phone(true); | ||
|
||
self::assertIsString($phoneNumber); | ||
self::assertNotEmpty($phoneNumber); | ||
} | ||
|
||
public function testPhoneNumberReturnsPhoneNumber(): void | ||
{ | ||
$phoneNumber = $this->faker->phoneNumber(); | ||
|
||
self::assertIsString($phoneNumber); | ||
self::assertNotEmpty($phoneNumber); | ||
} | ||
|
||
public function testPhoneNumberClearedReturnsPhoneNumber(): void | ||
{ | ||
$phoneNumber = $this->faker->phoneNumberCleared(); | ||
|
||
self::assertIsString($phoneNumber); | ||
self::assertNotEmpty($phoneNumber); | ||
} | ||
|
||
protected function getProviders(): iterable | ||
{ | ||
yield new Provider\pt_BR\PhoneNumber($this->faker); | ||
} | ||
} |