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 #410 from bessl/master
Browse files Browse the repository at this point in the history
Added ipv4 and barcode tests.
  • Loading branch information
fzaninotto committed Sep 1, 2014
2 parents 6486d8d + 3cfd266 commit 10d9057
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/Faker/Provider/BarcodeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Faker\Test\Provider;

use Faker\Generator;
use Faker\Provider\Barcode;

class BarcodeTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$faker = new Generator();
$faker->addProvider(new Barcode($faker));
$this->faker = $faker;
}

public function testEan8()
{
$this->assertRegExp('/[\d]{8}/', $this->faker->ean8());
}

public function testEan13()
{
$this->assertRegExp('/[\d]{13}/', $this->faker->ean13());
}
}
5 changes: 5 additions & 0 deletions test/Faker/Provider/InternetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public function testLocalIpv4()
$this->assertNotFalse(filter_var(Internet::localIpv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
}

public function testIpv4()
{
$this->assertNotFalse(filter_var($this->faker->ipv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
}

public function testIpv6()
{
$this->assertNotFalse(filter_var($this->faker->ipv6(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
Expand Down

0 comments on commit 10d9057

Please sign in to comment.