Blame view

libs/XML_Feed_Parser-1.0.2/tests/convertedtests/namespace.php 3.96 KB
42868d70   andryeyev   Создал GIT
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  <?php
  
  require_once 'XML_Feed_Parser_TestCase.php';
  
  class namespace_TestCase extends XML_Feed_Parser_Converted_TestCase {
  
      function test_rss1_0withModules_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModules.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('Test Item - RSS 1.0', $feed->getEntryByOffset(0)->title);
      }
  
      function test_rss1_0withModulesNoDefNS_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModulesNoDefNS.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('Test Item - RSS 1.0 no Default NS', $feed->getEntryByOffset(0)->title);
      }
  
      function test_rss1_0withModulesNoDefNSLocalNameClash_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss1.0withModulesNoDefNSLocalNameClash.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
      }
  
      function test_rss2_0noNSwithModules_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0noNSwithModules.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('Test Item - RSS 2.0 no NS', $feed->getEntryByOffset(0)->title);
      }
  
      function test_rss2_0noNSwithModulesLocalNameClash_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0noNSwithModulesLocalNameClash.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
      }
  
      function test_rss2_0NSwithModules_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModules.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('Test Item - RSS2.0 w/ NS', $feed->getEntryByOffset(0)->title);
      }
  
      function test_rss2_0NSwithModulesNoDefNS_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModulesNoDefNS.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('Test Item - - RSS2.0 w/ NS no default NS', $feed->getEntryByOffset(0)->title);
      }
  
      function test_rss2_0NSwithModulesNoDefNSLocalNameClash_1 () { 
          $content = file_get_contents($this->fp_test_dir . DIRECTORY_SEPARATOR . 'wellformed/namespace/rss2.0NSwithModulesNoDefNSLocalNameClash.xml');
          try {
              $feed = new XML_Feed_Parser($content);
          } catch (XML_Feed_Parser_Exception $e) {
              $this->assertTrue(false);
              return;
          }
          $this->assertEquals('correct description', $feed->getEntryByOffset(0)->description);
      }
  }
  
  $suite = new PHPUnit_TestSuite('namespace_TestCase');
  $result = PHPUnit::run($suite, '123');
  echo $result->toString();
  
  ?>