Issues (112)

tests/Common/BasicAttribute/PhoneNumberTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Tests\Common\BasicAttribute;
4
5
use Bpost\BpostApiClient\BpostException;
6
use Bpost\BpostApiClient\Common\BasicAttribute\PhoneNumber;
7
use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidLengthException;
8
use PHPUnit_Framework_TestCase;
0 ignored issues
show
The type PHPUnit_Framework_TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
class PhoneNumberTest extends PHPUnit_Framework_TestCase
11
{
12
    public function testValidate()
13
    {
14
        $value = str_repeat('a', 20);
15
        try {
16
            $test = new PhoneNumber($value);
17
            $this->assertEquals($value, $test->getValue());
18
        } catch (BpostException $ex) {
19
            $this->fail('Exception launched for valid value: "' . $value . '"');
20
        }
21
22
        $value = str_repeat('a', 21);
23
        try {
24
            new PhoneNumber($value);
25
            $this->fail('Exception uncaught for invalid value: "' . $value . '"');
26
        } catch (BpostInvalidLengthException $ex) {
27
            $this->assertTrue(true);
28
        }
29
    }
30
}
31