mirror of
https://github.com/marcostoll/FF-DataStructures.git
synced 2025-03-17 12:49:41 +01:00
[FEATURE] add phpunit code coverage
This commit is contained in:
parent
38b89f7da8
commit
cc37b305b8
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
.idea/
|
||||
|
||||
/build
|
||||
/logs
|
||||
/vendor
|
||||
composer.lock
|
3
bin/phpunit-codecoverage.bat
Normal file
3
bin/phpunit-codecoverage.bat
Normal file
@ -0,0 +1,3 @@
|
||||
@ECHO OFF
|
||||
SET PROJECT_HOME=C:\dev\ffe\fastforward\DataStructures
|
||||
php -dxdebug.coverage_enable=1 %PROJECT_HOME%\vendor\phpunit\phpunit\phpunit --coverage-xml %PROJECT_HOME%\logs\phpunit --configuration %PROJECT_HOME%\tests\testsuite.xml --teamcity
|
@ -103,9 +103,9 @@
|
||||
<!-- <coverage path="" /> -->
|
||||
<!-- @path - the directory where the xml code coverage report can be found -->
|
||||
<!--</source>-->
|
||||
<!--
|
||||
<source type="phpunit">
|
||||
<filter directory="${phpDox.project.source}" />
|
||||
<coverage path="../logs/phpunit" />
|
||||
</source>
|
||||
-->
|
||||
|
||||
|
@ -90,7 +90,17 @@ class OrderedCollectionTest extends TestCase
|
||||
/**
|
||||
* Tests the namesake method/feature
|
||||
*/
|
||||
public function testSetPush()
|
||||
public function testSetReplace()
|
||||
{
|
||||
$newValue = 'foo';
|
||||
$this->uut->setItems(self::SOME_ITEMS)->set(3, $newValue);
|
||||
$this->assertEquals($newValue, $this->uut[3]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the namesake method/feature
|
||||
*/
|
||||
public function testSetAppend()
|
||||
{
|
||||
$newItem = '5th';
|
||||
$this->uut->setItems(self::SOME_ITEMS)->set(42, $newItem);
|
||||
@ -198,6 +208,16 @@ class OrderedCollectionTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the namesake method/feature
|
||||
*/
|
||||
public function testPop()
|
||||
{
|
||||
$item = $this->uut->setItems(self::SOME_ITEMS)->pop();
|
||||
$this->assertEquals(self::SOME_ITEMS[3], $item);
|
||||
$this->assertEquals(count(self::SOME_ITEMS) - 1, count($this->uut));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the namesake method/feature
|
||||
*/
|
||||
|
@ -283,4 +283,17 @@ class RecordTest extends TestCase
|
||||
|
||||
$this->uut->get_something();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the namesake method/feature
|
||||
*/
|
||||
public function testIteratorAggregate()
|
||||
{
|
||||
$this->uut->setData(self::SOME_DATA);
|
||||
|
||||
foreach ($this->uut as $field => $value) {
|
||||
$this->assertArrayHasKey($field, self::SOME_DATA);
|
||||
$this->assertEquals(self::SOME_DATA[$field], $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,9 @@
|
||||
<directory>./</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">../src/</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
Loading…
x
Reference in New Issue
Block a user