Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1344 from gabriel-caruso/phpunit
Browse files Browse the repository at this point in the history
Use PSR-1 for PHPUnit TestCase
  • Loading branch information
fzaninotto authored Nov 6, 2017
2 parents 012cf35 + 0e9e7a3 commit 910a79d
Show file tree
Hide file tree
Showing 103 changed files with 220 additions and 118 deletions.
3 changes: 2 additions & 1 deletion test/Faker/Calculator/IbanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Calculator;

use Faker\Calculator\Iban;
use PHPUnit\Framework\TestCase;

class IbanTest extends \PHPUnit_Framework_TestCase
class IbanTest extends TestCase
{

public function checksumProvider()
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Calculator/InnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Calculator;

use Faker\Calculator\Inn;
use PHPUnit\Framework\TestCase;

class InnTest extends \PHPUnit_Framework_TestCase
class InnTest extends TestCase
{

public function checksumProvider()
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Calculator/LuhnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Calculator;

use Faker\Calculator\Luhn;
use PHPUnit\Framework\TestCase;

class LuhnTest extends \PHPUnit_Framework_TestCase
class LuhnTest extends TestCase
{

public function checkDigitProvider()
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/DefaultGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test;

use Faker\DefaultGenerator;
use PHPUnit\Framework\TestCase;

class DefaultGeneratorTest extends \PHPUnit_Framework_TestCase
class DefaultGeneratorTest extends TestCase
{
public function testGeneratorReturnsNullByDefault()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test;

use Faker\Generator;
use PHPUnit\Framework\TestCase;

class GeneratorTest extends \PHPUnit_Framework_TestCase
class GeneratorTest extends TestCase
{
public function testAddProviderGivesPriorityToNewlyAddedProvider()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\Address;
use PHPUnit\Framework\TestCase;

class AddressTest extends \PHPUnit_Framework_TestCase
class AddressTest extends TestCase
{
private $faker;

Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/BarcodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\Barcode;
use PHPUnit\Framework\TestCase;

class BarcodeTest extends \PHPUnit_Framework_TestCase
class BarcodeTest extends TestCase
{
private $faker;

Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\Base as BaseProvider;
use PHPUnit\Framework\TestCase;

class BaseTest extends \PHPUnit_Framework_TestCase
class BaseTest extends TestCase
{
public function testRandomDigitReturnsInteger()
{
Expand Down
13 changes: 7 additions & 6 deletions test/Faker/Provider/BiasedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@

use Faker\Provider\Biased;
use Faker\Generator;
use PHPUnit\Framework\TestCase;

class BiasedTest extends \PHPUnit_Framework_TestCase
class BiasedTest extends TestCase
{
const MAX = 10;
const NUMBERS = 25000;
protected $generator;
protected $results = array();

protected function setUp()
{
$this->generator = new Generator();
$this->generator->addProvider(new Biased($this->generator));

$this->results = array_fill(1, self::MAX, 0);
}

public function performFake($function)
{
for($i = 0; $i < self::NUMBERS; $i++) {
$this->results[$this->generator->biasedNumberBetween(1, self::MAX, $function)]++;
}
}

public function testUnbiased()
{
$this->performFake(array('\Faker\Provider\Biased', 'unbiased'));
Expand All @@ -40,7 +41,7 @@ public function testUnbiased()
$this->assertLessThan(self::NUMBERS * $assumed * 1.05, $amount, "Value was more than 5 percent over the expected value");
}
}

public function testLinearHigh()
{
$this->performFake(array('\Faker\Provider\Biased', 'linearHigh'));
Expand All @@ -54,7 +55,7 @@ public function testLinearHigh()
$this->assertLessThan(self::NUMBERS * $assumed * 1.1, $amount, "Value was more than 10 percent over the expected value");
}
}

public function testLinearLow()
{
$this->performFake(array('\Faker\Provider\Biased', 'linearLow'));
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/ColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\Color;
use PHPUnit\Framework\TestCase;

class ColorTest extends \PHPUnit_Framework_TestCase
class ColorTest extends TestCase
{

public function testHexColor()
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/CompanyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Faker\Generator;
use Faker\Provider\Company;
use Faker\Provider\Lorem;
use PHPUnit\Framework\TestCase;

class CompanyTest extends \PHPUnit_Framework_TestCase
class CompanyTest extends TestCase
{
/**
* @var Generator
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\DateTime as DateTimeProvider;
use PHPUnit\Framework\TestCase;

class DateTimeTest extends \PHPUnit_Framework_TestCase
class DateTimeTest extends TestCase
{
public function setUp()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/HtmlLoremTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\HtmlLorem;
use PHPUnit\Framework\TestCase;

class HtmlLoremTest extends \PHPUnit_Framework_TestCase
class HtmlLoremTest extends TestCase
{

public function testProvider()
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\Image;
use PHPUnit\Framework\TestCase;

class ImageTest extends \PHPUnit_Framework_TestCase
class ImageTest extends TestCase
{
public function testImageUrlUses640x680AsTheDefaultSize()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/InternetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
use Faker\Provider\Internet;
use Faker\Provider\Lorem;
use Faker\Provider\Person;
use PHPUnit\Framework\TestCase;

class InternetTest extends \PHPUnit_Framework_TestCase
class InternetTest extends TestCase
{
/**
* @var Generator
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/LocalizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Factory;
use PHPUnit\Framework\TestCase;

class LocalizationTest extends \PHPUnit_Framework_TestCase
class LocalizationTest extends TestCase
{
public function testLocalizedNameProvidersDoNotThrowErrors()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/LoremTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\Lorem;
use PHPUnit\Framework\TestCase;

class LoremTest extends \PHPUnit_Framework_TestCase
class LoremTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/MiscellaneousTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\Miscellaneous;
use PHPUnit\Framework\TestCase;

class MiscellaneousTest extends \PHPUnit_Framework_TestCase
class MiscellaneousTest extends TestCase
{
public function testBoolean()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use Faker\Provider\DateTime as DateTimeProvider;
use Faker\Provider\Payment as PaymentProvider;
use Faker\Provider\Person as PersonProvider;
use PHPUnit\Framework\TestCase;

class PaymentTest extends \PHPUnit_Framework_TestCase
class PaymentTest extends TestCase
{
private $faker;

Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Provider\Person;
use Faker\Generator;
use PHPUnit\Framework\TestCase;

class PersonTest extends \PHPUnit_Framework_TestCase
class PersonTest extends TestCase
{
/**
* @dataProvider firstNameProvider
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/PhoneNumberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use Faker\Generator;
use Faker\Calculator\Luhn;
use Faker\Provider\PhoneNumber;
use PHPUnit\Framework\TestCase;

class PhoneNumberTest extends \PHPUnit_Framework_TestCase
class PhoneNumberTest extends TestCase
{

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/ProviderOverrideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Faker\Test\Provider;

use Faker;
use PHPUnit\Framework\TestCase;

/**
* Class ProviderOverrideTest
Expand All @@ -16,7 +17,7 @@
* locale specific provider (can) has specific implementations. The goal of this test is to test the common denominator
* and to try to catch possible invalid multi-byte sequences.
*/
class ProviderOverrideTest extends \PHPUnit_Framework_TestCase
class ProviderOverrideTest extends TestCase
{
/**
* Constants with regular expression patterns for testing the output.
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/TextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

use Faker\Provider\en_US\Text;
use Faker\Generator;
use PHPUnit\Framework\TestCase;

class TextTest extends \PHPUnit_Framework_TestCase
class TextTest extends TestCase
{
public function testTextMaxLength()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/UserAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
namespace Faker\Test\Provider;

use Faker\Provider\UserAgent;
use PHPUnit\Framework\TestCase;

class UserAgentTest extends \PHPUnit_Framework_TestCase
class UserAgentTest extends TestCase
{
public function testRandomUserAgent()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/UuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\Uuid as BaseProvider;
use PHPUnit\Framework\TestCase;

class UuidTest extends \PHPUnit_Framework_TestCase
class UuidTest extends TestCase
{
public function testUuidReturnsUuid()
{
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/ar_JO/InternetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use Faker\Provider\fi_FI\Person;
use Faker\Provider\fi_FI\Internet;
use Faker\Provider\fi_FI\Company;
use PHPUnit\Framework\TestCase;

class InternetTest extends \PHPUnit_Framework_TestCase
class InternetTest extends TestCase
{

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/ar_SA/InternetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
use Faker\Provider\ar_SA\Person;
use Faker\Provider\ar_SA\Internet;
use Faker\Provider\ar_SA\Company;
use PHPUnit\Framework\TestCase;

class InternetTest extends \PHPUnit_Framework_TestCase
class InternetTest extends TestCase
{

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/at_AT/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\at_AT\Payment;
use PHPUnit\Framework\TestCase;

class PaymentTest extends \PHPUnit_Framework_TestCase
class PaymentTest extends TestCase
{

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/bg_BG/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\bg_BG\Payment;
use PHPUnit\Framework\TestCase;

class PaymentTest extends \PHPUnit_Framework_TestCase
class PaymentTest extends TestCase
{

/**
Expand Down
3 changes: 2 additions & 1 deletion test/Faker/Provider/bn_BD/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

use Faker\Generator;
use Faker\Provider\bn_BD\Person;
use PHPUnit\Framework\TestCase;

class PersonTest extends \PHPUnit_Framework_TestCase
class PersonTest extends TestCase
{
public function setUp()
{
Expand Down
5 changes: 3 additions & 2 deletions test/Faker/Provider/cs_CZ/PersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
use Faker\Generator;
use Faker\Provider\cs_CZ\Person;
use Faker\Provider\Miscellaneous;
use PHPUnit\Framework\TestCase;

class PersonTest extends \PHPUnit_Framework_TestCase
class PersonTest extends TestCase
{
public function testBirthNumber()
{
$faker = new Generator();
$faker->addProvider(new Person($faker));
$faker->addProvider(new Miscellaneous($faker));

for ($i = 0; $i < 1000; $i++) {
for ($i = 0; $i < 1000; $i++) {
$birthNumber = $faker->birthNumber();
$birthNumber = str_replace('/', '', $birthNumber);

Expand Down
Loading

0 comments on commit 910a79d

Please sign in to comment.