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

Added en_NZ unit test folder + PhoneNumberTest.php #772

Merged
merged 1 commit into from
Feb 23, 2016
Merged
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
35 changes: 35 additions & 0 deletions test/Faker/Provider/en_NZ/PhoneNumberTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Faker\Test\Provider\en_NZ;

use Faker\Generator;
use Faker\Provider\en_NZ\PhoneNumber;

class PhoneNumberTest extends \PHPUnit_Framework_TestCase
{

/**
* @var Faker\Generator
*/
private $faker;

public function setUp()
{
$faker = new Generator();
$faker->addProvider(new PhoneNumber($faker));
$this->faker = $faker;
}

public function testIfPhoneNumberCanReturnData()
{
$number = $this->faker->phoneNumber;
$this->assertNotEmpty($number);
}

public function phoneNumberFormat()
{
$number = $this->faker->phoneNumber;
$this->assertRegExp('/(^\([0]\d{1}\))(\d{7}$)|(^\([0][2]\d{1}\))(\d{6,8}$)|([0][8][0][0])([\s])(\d{5,8}$)/', $number);
}
}
?>