File: oldtests.php

package info (click to toggle)
simplepie 1.5.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,496 kB
  • sloc: php: 28,734; sql: 34; makefile: 10; sh: 4
file content (85 lines) | stat: -rw-r--r-- 2,575 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php

date_default_timezone_set('UTC');
error_reporting(E_ALL | E_STRICT);

require_once dirname(__FILE__) . '/bootstrap.php';
require_once dirname(__FILE__) . '/oldtests/compat_test_harness.php';
require_once dirname(__FILE__) . '/oldtests/functions.php';

class OldTest extends PHPUnit\Framework\TestCase
{
    public function getTests()
    {
        $test_folders = array(
            'absolutize',
            'date',
            'feed_category_label',
            'feed_copyright',
            'feed_description',
            'feed_image_height',
            'feed_image_link',
            'feed_image_title',
            'feed_image_url',
            'feed_image_width',
            'feed_language',
            'feed_link',
            'feed_title',
            'first_item_author_name',
            'first_item_category_label',
            'first_item_content',
            'first_item_contributor_name',
            'first_item_date',
            'first_item_description',
            'first_item_id',
            'first_item_latitude',
            'first_item_longitude',
            'first_item_permalink',
            'first_item_title',
            'itunes_rss'
        );

        $master = new Unit_Test2_Group('SimplePie Test Suite');

        foreach ($test_folders as $test)
        {
            $test_group = new SimplePie_Unit_Test2_Group(ucwords(str_replace('_', ' ', $test)));
            $test_group->load_folder(dirname(__FILE__) . '/oldtests/' . $test);
            $master->add($test_group);
        }

        $test_group = new SimplePie_Unit_Test2_Group('Who knows a <title> from a hole in the ground?');
        $test_group->load_folder(dirname(__FILE__) . '/oldtests/who_knows_a_title_from_a_hole_in_the_ground');
        $master->add($test_group);

        $tests = array();
        $groups = array($master);
        while ($group = array_shift($groups))
        {
            foreach ($group->tests as $group_tests)
            {
                foreach ($group_tests as $test)
                {
                    if ($test instanceof Unit_Test2)
                    {
                        $tests[] = array($test);
                    }
                    elseif ($test instanceof Unit_Test2_Group)
                    {
                        $groups[] = $test;
                    }
                }
            }
        }
        return $tests;
    }

    /**
     * @dataProvider getTests
     */
    public function testOld($test)
    {
        $test->run();
        $this->assertSame($test->expected, $test->result);
    }
}