Code Duplication    Length = 59-60 lines in 3 locations

tests/unit/xsNormalizedStringTest.php 1 location

@@ 9-67 (lines=59) @@
6
/**
7
 * Generated Test Class.
8
 */
9
class xsNormalizedStringTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * Sets up the fixture, for example, opens a network connection.
13
     * This method is called before a test is executed.
14
     */
15
    protected function setUp()
16
    {
17
        parent::setUp();
18
    }
19
20
    /**
21
     * Tears down the fixture, for example, closes a network connection.
22
     * This method is called after a test is executed.
23
     */
24
    protected function tearDown()
25
    {
26
        parent::tearDown();
27
    }
28
29
    /**
30
     * @dataProvider testxsNormalizedStringTestValidDataProvider
31
     */
32
    public function testxsNormalizedStringTestValid($duration, $message) {
33
        $d = new xsNormalizedString($duration);
34
        $e = (string)$d;
35
        $this->assertEquals($duration,$e,$message);
36
37
    }
38
39
    public function testxsNormalizedStringTestValidDataProvider()
40
    {
41
        return array(
42
            array('This is a string!', 'normal string'),
43
            array('Édition française.', 'unicodeString'),
44
            array('12.5	', 'number as string'),
45
            array('', 'an empty string is valid'),
46
            array('PB&J', 'when parsed, it will become "PB&J"'),
47
            array('   Separated by 3 spaces.', 'when parsed, it will become "Separated by 3 spaces."'),
48
            array('This
49
is on two lines.', 'when parsed, the line break will be replaced with a space'),
50
        );
51
    }
52
    /**
53
     * @dataProvider testxsNormalizedStringTestInvalidDataProvider
54
     */
55
    public function testxsNormalizedStringTestInvalid($duration, $message) {
56
            $d = new xsNormalizedString($duration);
57
            $e = (string)$d;
58
            $this->assertEquals('',$e,$message);
59
    }
60
61
    public function testxsNormalizedStringTestInvalidDataProvider() {
62
        return array(
63
            array('AT&T', 'ampersand must be escaped'),
64
            array('3 < 4', 'the "less than" symbol must be escaped'),
65
        );
66
    }
67
}
68

tests/unit/xsStringTest.php 1 location

@@ 9-68 (lines=60) @@
6
/**
7
 * Generated Test Class.
8
 */
9
class xsStringTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * Sets up the fixture, for example, opens a network connection.
13
     * This method is called before a test is executed.
14
     */
15
    protected function setUp()
16
    {
17
        parent::setUp();
18
    }
19
20
    /**
21
     * Tears down the fixture, for example, closes a network connection.
22
     * This method is called after a test is executed.
23
     */
24
    protected function tearDown()
25
    {
26
        parent::tearDown();
27
    }
28
29
    /**
30
     * @dataProvider testxsStringTestValidDataProvider
31
     */
32
    public function testxsStringTestValid($duration, $message) {
33
        $d = new xsUnsignedShort($duration);
34
        $e = (string)$d;
35
        $this->assertEquals($duration,$e,$message);
36
37
    }
38
39
    public function testxsStringTestValidDataProvider()
40
    {
41
        return array(
42
            array('This is a string!', 'normal string'),
43
            array('Édition française.', 'unicodeString'),
44
            array('12.5	', 'number as string'),
45
            array('', 'an empty string is valid'),
46
            array('PB&amp;J', 'when parsed, it will become "PB&J"'),
47
            array('   Separated by 3 spaces.', ''),
48
            array('This
49
is on two lines.', ''),
50
        );
51
    }
52
    /**
53
     * @dataProvider testxsStringTestInvalidDataProvider
54
     */
55
    public function testxsStringTestInvalid($duration, $message) {
56
            $d = new xsUnsignedShort($duration);
57
            $e = (string)$d;
58
            $this->assertEquals('',$e,$message);
59
60
    }
61
62
    public function testxsStringTestInvalidDataProvider() {
63
        return array(
64
            array('AT&T', 'ampersand must be escaped'),
65
            array('3 < 4', 'the "less than" symbol must be escaped'),
66
        );
67
    }
68
}
69

tests/unit/xsTokenTest.php 1 location

@@ 9-68 (lines=60) @@
6
/**
7
 * Generated Test Class.
8
 */
9
class xsTokenTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * Sets up the fixture, for example, opens a network connection.
13
     * This method is called before a test is executed.
14
     */
15
    protected function setUp()
16
    {
17
        parent::setUp();
18
    }
19
20
    /**
21
     * Tears down the fixture, for example, closes a network connection.
22
     * This method is called after a test is executed.
23
     */
24
    protected function tearDown()
25
    {
26
        parent::tearDown();
27
    }
28
29
    /**
30
     * @dataProvider testxsTokenTestValidDataProvider
31
     */
32
    public function testxsTokenTestValid($duration, $message) {
33
        $d = new xsToken($duration);
34
        $e = (string)$d;
35
        $this->assertEquals($duration,$e,$message);
36
37
    }
38
39
    public function testxsTokenTestValidDataProvider()
40
    {
41
        return array(
42
            array('This is a string!', 'normal string'),
43
            array('Édition française.', 'unicodeString'),
44
            array('12.5	', 'number as string'),
45
            array('', 'an empty string is valid'),
46
            array('PB&amp;J', 'when parsed, it will become "PB&J"'),
47
            array('   Separated by 3 spaces.', 'when parsed, it will become "Separated by 3 spaces."'),
48
            array('This
49
is on two lines.', 'when parsed, the line break will be replaced with a space'),
50
        );
51
    }
52
    /**
53
     * @dataProvider testxsTokenTestInvalidDataProvider
54
     */
55
    public function testxsTokenTestInvalid($duration, $message) {
56
            $d = new xsToken($duration);
57
            $e = (string)$d;
58
            $this->assertEquals('',$e,$message);
59
60
    }
61
62
    public function testxsTokenTestInvalidDataProvider() {
63
        return array(
64
            array('AT&T', 'ampersand must be escaped'),
65
            array('3 < 4', 'the "less than" symbol must be escaped'),
66
        );
67
    }
68
}
69