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

Added ipv4 and barcode tests. #410

Merged
merged 2 commits into from
Sep 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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