Skip to content

Commit 5fc5279

Browse files
committed
Remove mockery from tests
1 parent 292b4c5 commit 5fc5279

File tree

5 files changed

+8
-142
lines changed

5 files changed

+8
-142
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"phpdocumentor/reflection-common": "^2.0"
1515
},
1616
"require-dev": {
17-
"mockery/mockery": "~1",
1817
"ext-tokenizer": "^7.2"
1918
},
2019
"autoload": {

composer.lock

Lines changed: 3 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml.dist

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,4 @@
2727
<log type="coverage-clover" target="build/logs/clover.xml"/>
2828
<log type="junit" target="build/logs/junit.xml"/>
2929
</logging>
30-
<listeners>
31-
<listener class="Mockery\Adapter\Phpunit\TestListener"
32-
file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php"></listener>
33-
</listeners>
3430
</phpunit>

tests/unit/TypeResolverTest.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace phpDocumentor\Reflection;
1515

16-
use Mockery as m;
1716
use phpDocumentor\Reflection\Types\Array_;
1817
use phpDocumentor\Reflection\Types\Boolean;
1918
use phpDocumentor\Reflection\Types\ClassString;
@@ -35,14 +34,6 @@
3534
*/
3635
class TypeResolverTest extends TestCase
3736
{
38-
/**
39-
* Call Mockery::close after each test.
40-
*/
41-
public function tearDown() : void
42-
{
43-
m::close();
44-
}
45-
4637
/**
4738
* @uses \phpDocumentor\Reflection\Types\Context
4839
* @uses \phpDocumentor\Reflection\Types\Array_
@@ -146,13 +137,13 @@ public function testResolvingRelativeQSENsBasedOnNamespaceAlias() : void
146137
$fixture = new TypeResolver();
147138

148139
$resolvedType = $fixture->resolve(
149-
'm\MockInterface',
150-
new Context('phpDocumentor\Reflection', ['m' => m::class])
140+
'm\Array_',
141+
new Context('phpDocumentor\Reflection', ['m' => '\phpDocumentor\Reflection\Types'])
151142
);
152143

153144
$this->assertInstanceOf(Object_::class, $resolvedType);
154145
$this->assertInstanceOf(Fqsen::class, $resolvedType->getFqsen());
155-
$this->assertSame('\Mockery\MockInterface', (string) $resolvedType);
146+
$this->assertSame('\phpDocumentor\Reflection\Types\Array_', (string) $resolvedType);
156147
}
157148

158149
/**
@@ -645,7 +636,7 @@ public function testResolvingCompoundTypesWithTwoArrays() : void
645636
public function testAddingAKeyword() : void
646637
{
647638
// Assign
648-
$typeMock = m::mock(Type::class);
639+
$typeMock = self::createStub(Type::class);
649640

650641
// Act
651642
$fixture = new TypeResolver();

tests/unit/Types/ContextFactoryTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace phpDocumentor\Reflection\Types {
1212

1313
// Added imports on purpose as mock for the unit tests, please do not remove.
14-
use Mockery as m, phpDocumentor;
14+
use phpDocumentor\Reflection\Fqsen as m, phpDocumentor;
1515
use phpDocumentor\Reflection\DocBlock;
1616
use phpDocumentor\Reflection\DocBlock\Tag;
1717
use PHPUnit\Framework\TestCase; // yes, the slash is part of the test
@@ -191,11 +191,6 @@ public function assertNamespaceAliasesFrom(Context $context)
191191

192192
$this->assertSame($expected, $actual);
193193
}
194-
195-
public function tearDown() : void
196-
{
197-
m::close();
198-
}
199194
}
200195
}
201196

0 commit comments

Comments
 (0)