-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from yondifon/add_pests_tests
add pests tests fixes #3
- Loading branch information
Showing
5 changed files
with
71 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/vendor | ||
.phpunit.result.cache | ||
.phpunit.result.cache | ||
composer.lock |
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 |
---|---|---|
|
@@ -2,19 +2,24 @@ | |
"name": "malico/mobile-cm-php", | ||
"description": "Get Telephone number's Mobile Network", | ||
"license": "MIT", | ||
"archive": { | ||
"exclude": [ | ||
"tests" | ||
] | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Malico", | ||
"email": "[email protected]" | ||
} | ||
|
||
], | ||
"autoload": | ||
{ | ||
"psr-4": | ||
{ | ||
"autoload": { | ||
"psr-4": { | ||
"Malico\\MobileCM\\": "src/" | ||
} | ||
}, | ||
"minimum-stability": "dev" | ||
"minimum-stability": "dev", | ||
"require-dev": { | ||
"pestphp/pest": "1.x-dev" | ||
} | ||
} |
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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./app</directory> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
</phpunit> |
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,39 @@ | ||
<?php | ||
|
||
use Malico\MobileCM\Network; | ||
|
||
test('test mtn numbers', function () { | ||
$numbers = ['676777777', '237676777777', '676 77 77 77', '+237676777777', '00237676777777']; | ||
|
||
expect($numbers)->each( | ||
fn ($number) => expect(Network::isMTN($number->value)) | ||
->toBe(true) | ||
); | ||
}); | ||
|
||
test('test orange numbers', function () { | ||
$numbers = ['699238282', '237699238282', '+237699238282', '00237699238282']; | ||
|
||
expect($numbers)->each( | ||
fn ($number) => expect(Network::isOrange($number->value)) | ||
->toBe(true) | ||
); | ||
}); | ||
|
||
test('test nexttel numbers', function () { | ||
$numbers = ['666768293', '237666768293', '+237666768293', '00237666768293']; | ||
|
||
expect($numbers)->each( | ||
fn ($number) => expect(Network::isNexttel($number->value)) | ||
->toBe(true) | ||
); | ||
}); | ||
|
||
test('test camtel numbers', function () { | ||
$numbers = ['2 33 47 99 73', '2 22 47 99 73']; | ||
|
||
expect($numbers)->each( | ||
fn ($number) => expect(Network::isCamtel($number->value)) | ||
->toBe(true) | ||
); | ||
}); |
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 @@ | ||
<?php |