Skip to content

Commit e0a69d7

Browse files
committed
add some new tests & update README for code coverage :)
1 parent 41c1438 commit e0a69d7

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PayTech - PHP API Client (installable with Composer)
22

3-
[![Coverage Status](https://img.shields.io/badge/coverage-100%25-success)](https://coveralls.io/github/PapiHack/paytech-php-client?branch=master)
3+
[![Coverage Status](https://img.shields.io/badge/coverage-99.25%25-success)](https://coveralls.io/github/PapiHack/paytech-php-client?branch=master)
44
![Issues](https://img.shields.io/github/issues/PapiHack/paytech-php-client)
55
![PR](https://img.shields.io/github/issues-pr/PapiHack/paytech-php-client)
66
[![Latest Stable Version](https://poser.pugx.org/papihack/paytech-php-client/v)](//packagist.org/packages/papihack/paytech-php-client)

src/Utils/Check.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ public static function isCurrencyAllowed($currency)
3131

3232
public static function isEnvAllowed($env)
3333
{
34-
return array_search(strtoupper($env), self::autorizedEnv);
34+
return in_array(strtoupper($env), self::autorizedEnv);
3535
}
3636
}

tests/Unit/PayTech/ConfigTest.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,14 @@
5858
it('Should raise an CurrencyException when currency is not allowed', function () {
5959
$this->expectException(\PayTech\Exceptions\CurrencyException::class);
6060
Config::setCurrency('dummy currency');
61-
});
61+
});
62+
63+
it('Should raise an Exception when env is not allowed', function () {
64+
$this->expectException(\Exception::class);
65+
Config::setEnv('dummyEnv');
66+
});
67+
68+
it('Should set Env when env is allowed', function () {
69+
Config::setEnv(\PayTech\Enums\Environment::TEST);
70+
$this->assertIsString(Config::getEnv());
71+
});

0 commit comments

Comments
 (0)