Skip to content

Commit

Permalink
Merge pull request #11 from jakzal/tools-update
Browse files Browse the repository at this point in the history
Update tools
  • Loading branch information
jakzal committed Jun 11, 2019
2 parents 733da28 + 06fa5ef commit 5e928cc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ tools/deptrac:
curl -Ls http://get.sensiolabs.de/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac

tools/infection: tools/infection.pubkey
curl -Ls https://github.com/infection/infection/releases/download/0.12.0/infection.phar -o tools/infection && chmod +x tools/infection
curl -Ls https://github.com/infection/infection/releases/download/0.13.2/infection.phar -o tools/infection && chmod +x tools/infection

tools/infection.pubkey:
curl -Ls https://github.com/infection/infection/releases/download/0.12.0/infection.phar.pubkey -o tools/infection.pubkey
curl -Ls https://github.com/infection/infection/releases/download/0.13.2/infection.phar.pubkey -o tools/infection.pubkey

tools/box:
curl -Ls https://github.com/humbug/box/releases/download/3.4.0/box.phar -o tools/box && chmod +x tools/box
curl -Ls https://github.com/humbug/box/releases/download/3.7.3/box.phar -o tools/box && chmod +x tools/box

tests/phar/tools/phpunit:
curl -Ls https://phar.phpunit.de/phpunit-8.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
Expand Down
5 changes: 5 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
},
"mutators": {
"@default": true,
"ArrayItemRemoval": {
"ignore": [
"Zalas\\PHPUnit\\Doubles\\TestCase\\TestDoubles::initialiseTestDoubles"
]
},
"IdenticalEqual": false,
"NotIdenticalNotEqual": false
}
Expand Down
16 changes: 14 additions & 2 deletions tests/PhpDocumentor/ReflectionExtractorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Zalas\PHPUnit\Doubles\Tests\PhpDocumentor;

use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Zalas\PHPUnit\Doubles\Extractor\Extractor;
use Zalas\PHPUnit\Doubles\Extractor\Property;
Expand All @@ -12,6 +11,7 @@
use Zalas\PHPUnit\Doubles\Tests\PhpDocumentor\Fixtures\Character\Rincewind;
use Zalas\PHPUnit\Doubles\Tests\PhpDocumentor\Fixtures\Character\Troll;
use Zalas\PHPUnit\Doubles\Tests\PhpDocumentor\Fixtures\Discworld;
use Zalas\PHPUnit\Doubles\Tests\PhpDocumentor\Fixtures\World;
use Zalas\PHPUnit\Doubles\Tests\PhpDocumentor\Fixtures\World\Elephant;

class ReflectionExtractorTest extends TestCase
Expand All @@ -23,7 +23,7 @@ class ReflectionExtractorTest extends TestCase

protected function setUp(): void
{
$this->extractor = new ReflectionExtractor([TestCase::class, Assert::class]);
$this->extractor = new ReflectionExtractor([]);
}

public function test_it_is_an_extractor()
Expand Down Expand Up @@ -58,6 +58,18 @@ public function test_it_filters_properties_out()
$this->assertProperty('rincewind', [Rincewind::class], $properties[0]);
}

public function test_it_ignores_properties_by_class()
{
$this->extractor = new ReflectionExtractor([World::class]);

$properties = $this->extractor->extract(new Discworld(), function (Property $property) {
return true;
});

$this->assertContainsOnlyInstancesOf(Property::class, $properties);
$this->assertCount(5, $properties);
}

private function assertProperty(string $name, array $types, $property)
{
$this->assertSame($name, $property->getName());
Expand Down

0 comments on commit 5e928cc

Please sign in to comment.