DumpIteratorTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIterationWorks() 0 6 1
A getFilePath() 0 3 1
1
<?php
2
3
namespace Tests\Queryr\DumpReader;
4
5
use Queryr\DumpReader\DumpIterator;
6
use Queryr\DumpReader\XmlReader\DumpXmlReader;
7
8
/**
9
 * @covers Queryr\DumpReader\DumpIterator
10
 *
11
 * @licence GNU GPL v2+
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class DumpIteratorTest extends \PHPUnit_Framework_TestCase {
15
16
	public function testIterationWorks() {
17
		$iterator = new DumpIterator( new DumpXmlReader( $this->getFilePath( 'simple/two-items.xml' ) ) );
18
19
		$this->assertCount( 2, iterator_to_array( $iterator ) );
20
		$this->assertContainsOnlyInstancesOf( 'Queryr\DumpReader\Page', $iterator );
21
	}
22
23
	private function getFilePath( $fileName ) {
24
		return __DIR__ . '/../../data/' . $fileName;
25
	}
26
27
}