Completed
Push — master ( 7d3f1b...723e15 )
by Mia
03:14
created

CRSSFeedTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetFeed() 0 5 1
1
<?php
2
/**
3
 * A test class for testing RSSFeed class
4
 * 
5
 */
6
7
namespace Miax\RSSFeed;
8
use SimplePie;
9
10
//change the cache directory to wherever you want it
11
//define('CACHE', __DIR__.'/../webroot/cache/');
12
13
//require_once(__DIR__.'/../simplepie/simplepie_1.3.1.mini.php');
0 ignored issues
show
Unused Code Comprehensibility introduced by
80% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
14
//require_once(__DIR__.'/../CRSSFeed.php');
15
16
class CRSSFeedTest extends \PHPUnit_Framework_TestCase {
17
   
18
   private $feed;
19
   
20
   /*public function setUp(){
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
21
	   $this->feed = new \Miax\RSSFeed\CRSSFeed(['http://feeds.feedburner.com/idg/vzzs']);
22
	   $test = get_items($this->feed);
23
	   $exp = "\Miax\RSSFeed\CRSSFeed";
24
	   $this->assertEquals($test, $exp, "Wrong items");
25
   }*/
26
   
27
  /**
28
     * Test 
29
     *
30
     * @return void
31
     *
32
     */
33
  public function testGetFeed() {
34
    $this->feed = new \Miax\RSSFeed\CRSSFeed(['http://feeds.feedburner.com/idg/vzzs']);
35
	   $content = $this->feed->getFeed();
36
	   $this->assertInternalType('string', $content, "Return type is not a string");
37
  } 
38
}