Completed
Push — master ( e60a6a...7a7a1d )
by Mia
03:34 queued 12s
created

test/RSSFeed/CRSSFeedTest.php (2 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * A test class for testing RSSFeed class
4
 * 
5
 */
6
7
namespace Miax\RSSFeed;
8
use SimplePie;
9
use Miax\RSSFeed\CRSSFeed;
10
require_once(__DIR__."/../../src/RSSFeed/simplepie/simplepie_1.3.1.mini.php");
11
require_once(__DIR__."/../../src/RSSFeed/CRSSFeed.php");
12
13
      
14
class CRSSFeedTest extends \PHPUnit_Framework_TestCase {
15
	
16
	
17
	/** -------------------------------------------------------
18
     * Test 1a
19
	 *  
20
     */
21
	 
22
	 
23
	 private $feed;
24
	 
25
	
26
	 public function setUp(){
27
		$rss = new SimplePie();
28
		$rss->get_items(1,1);
29
	  	$this->feed = new CRSSFeed($rss);
30
	 }
31
	 
32
	 
33
	 public function testAssertTags(){		
34
		$matcher = array(
0 ignored issues
show
$matcher is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
35
		'tag' => 'h1', 'content' => 'regexp:/<h1>.*<\/h1>/',
36
		'parent' => array('tag' => 'article')
37
		);
38
		 
39
		$matchFeed = array(
0 ignored issues
show
$matchFeed is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
40
		  'tag'=> 'h2', 'content' => 'regexp:/<h2>.*<\/h2>/',
41
		  'tag'=> 'small', 'content' => 'regexp:/<small>.*<\/small>/',
42
		  'tag'=> 'p', 'content' => 'regexp:/<p>.*<\/p>/',
43
		  'parent' => array('tag' => 'div', 'attributes' => array('class' => 'feed-content'))
44
		);	
45
	 }
46
	 
47
	 
48
	 public function testGetFeed(){
49
		$this->assertInternalType('string', 'regexp:/<article>.*<\/article>/');
50
	 }
51
}