Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct PHPUnit MockObject class names as per PHPUnit 8+ #466

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionClassConstantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionClassConstant as CoreReflectionClassConstant;
use Roave\BetterReflection\Reflection\Adapter\ReflectionClassConstant as ReflectionClassConstantAdapter;
Expand Down Expand Up @@ -61,7 +61,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, $returnValue, array $args) : void
{
/** @var BetterReflectionClassConstant|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionClassConstant|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionClassConstant::class);

$reflectionStub->expects($this->once())
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Roave\BetterReflectionTest\Reflection\Adapter;

use OutOfBoundsException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionException as CoreReflectionException;
use Roave\BetterReflection\Reflection\Adapter\Exception\NotImplemented;
Expand Down Expand Up @@ -113,7 +113,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionClass|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionClass|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionClass::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Roave\BetterReflectionTest\Reflection\Adapter;

use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionException as CoreReflectionException;
use ReflectionFunction as CoreReflectionFunction;
Expand Down Expand Up @@ -96,7 +96,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionFunction|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionFunction|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionFunction::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionException as CoreReflectionException;
use ReflectionMethod as CoreReflectionMethod;
Expand Down Expand Up @@ -112,7 +112,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionMethod|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionMethod|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionMethod::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionException as CoreReflectionException;
use ReflectionObject as CoreReflectionObject;
Expand Down Expand Up @@ -108,7 +108,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionObject|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionObject|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionObject::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionParameter as CoreReflectionParameter;
use Roave\BetterReflection\Reflection\Adapter\ReflectionParameter as ReflectionParameterAdapter;
Expand Down Expand Up @@ -86,7 +86,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionParameter|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionParameter|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionParameter::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionPropertyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionException as CoreReflectionException;
use ReflectionProperty as CoreReflectionProperty;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, $returnValue, array $args) : void
{
/** @var BetterReflectionProperty|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionProperty|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionProperty::class);

$reflectionStub->expects($this->once())
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflection/Adapter/ReflectionTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflection\Adapter;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use ReflectionClass as CoreReflectionClass;
use ReflectionType as CoreReflectionType;
use Roave\BetterReflection\Reflection\Adapter\ReflectionType;
Expand Down Expand Up @@ -56,7 +56,7 @@ public function methodExpectationProvider() : array
*/
public function testAdapterMethods(string $methodName, ?string $expectedException, $returnValue, array $args) : void
{
/** @var BetterReflectionType|PHPUnit_Framework_MockObject_MockObject $reflectionStub */
/** @var BetterReflectionType|MockObject $reflectionStub */
$reflectionStub = $this->createMock(BetterReflectionType::class);

if ($expectedException === null) {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflector/ClassReflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflector;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Roave\BetterReflection\Reflection\ReflectionClass;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\Reflector\Exception\IdentifierNotFound;
Expand All @@ -32,7 +32,7 @@ public function testReflectProxiesToSourceLocator() : void
{
$reflection = $this->createMock(ReflectionClass::class);

/** @var StringSourceLocator|PHPUnit_Framework_MockObject_MockObject $sourceLocator */
/** @var StringSourceLocator|MockObject $sourceLocator */
$sourceLocator = $this
->getMockBuilder(StringSourceLocator::class)
->disableOriginalConstructor()
Expand Down
4 changes: 2 additions & 2 deletions test/unit/Reflector/FunctionReflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Roave\BetterReflectionTest\Reflector;

use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Roave\BetterReflection\Reflection\ReflectionFunction;
use Roave\BetterReflection\Reflector\ClassReflector;
use Roave\BetterReflection\Reflector\FunctionReflector;
Expand All @@ -32,7 +32,7 @@ public function testReflectProxiesToGenericReflectMethod() : void
{
$reflection = $this->createMock(ReflectionFunction::class);

/** @var StringSourceLocator|PHPUnit_Framework_MockObject_MockObject $sourceLocator */
/** @var StringSourceLocator|MockObject $sourceLocator */
$sourceLocator = $this
->getMockBuilder(StringSourceLocator::class)
->disableOriginalConstructor()
Expand Down
26 changes: 13 additions & 13 deletions test/unit/SourceLocator/Ast/FindReflectionsInTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Roave\BetterReflectionTest\Reflector;

use PhpParser\Node;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Roave\BetterReflection\Identifier\IdentifierType;
use Roave\BetterReflection\Reflection\ReflectionClass;
use Roave\BetterReflection\Reflection\ReflectionFunction;
Expand All @@ -31,13 +31,13 @@ private function getAstForSource(LocatedSource $source) : array

public function testInvokeDoesNotCallReflectNodesWhenNoNodesFoundInEmptyAst() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$strategy->expects($this->never())
->method('__invoke');

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php', null);

Expand All @@ -54,13 +54,13 @@ public function testInvokeDoesNotCallReflectNodesWhenNoNodesFoundInEmptyAst() :

public function testInvokeDoesNotCallReflectNodesWhenNoNodesFoundInPopulatedAst() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$strategy->expects($this->never())
->method('__invoke');

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php echo "Hello world";', null);

Expand All @@ -77,7 +77,7 @@ public function testInvokeDoesNotCallReflectNodesWhenNoNodesFoundInPopulatedAst(

public function testInvokeCallsReflectNodesForClassWithoutNamespace() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$mockReflection = $this->createMock(ReflectionClass::class);
Expand All @@ -86,7 +86,7 @@ public function testInvokeCallsReflectNodesForClassWithoutNamespace() : void
->method('__invoke')
->will($this->returnValue($mockReflection));

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php class Foo {}', null);

Expand All @@ -103,7 +103,7 @@ public function testInvokeCallsReflectNodesForClassWithoutNamespace() : void

public function testInvokeCallsReflectNodesForNamespacedClass() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$mockReflection = $this->createMock(ReflectionClass::class);
Expand All @@ -112,7 +112,7 @@ public function testInvokeCallsReflectNodesForNamespacedClass() : void
->method('__invoke')
->will($this->returnValue($mockReflection));

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php namespace Foo { class Bar {} }', null);

Expand All @@ -129,7 +129,7 @@ public function testInvokeCallsReflectNodesForNamespacedClass() : void

public function testInvokeCallsReflectNodesForFunction() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$mockReflection = $this->createMock(ReflectionFunction::class);
Expand All @@ -138,7 +138,7 @@ public function testInvokeCallsReflectNodesForFunction() : void
->method('__invoke')
->will($this->returnValue($mockReflection));

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php function foo() {}', null);

Expand All @@ -155,7 +155,7 @@ public function testInvokeCallsReflectNodesForFunction() : void

public function testAnonymousClassCreatedInFunction() : void
{
/** @var NodeToReflection|PHPUnit_Framework_MockObject_MockObject $strategy */
/** @var NodeToReflection|MockObject $strategy */
$strategy = $this->createMock(NodeToReflection::class);

$mockReflectionFunction = $this->createMock(ReflectionFunction::class);
Expand All @@ -165,7 +165,7 @@ public function testAnonymousClassCreatedInFunction() : void
->method('__invoke')
->willReturnOnConsecutiveCalls($mockReflectionFunction, $mockReflectionClass);

/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);
$locatedSource = new LocatedSource('<?php function foo() {return new class {};}', null);

Expand Down
4 changes: 2 additions & 2 deletions test/unit/SourceLocator/Ast/Parser/MemoizingParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use PhpParser\Node;
use PhpParser\Parser;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Roave\BetterReflection\SourceLocator\Ast\Parser\MemoizingParser;
use function array_map;
use function array_unique;
Expand All @@ -23,7 +23,7 @@ class MemoizingParserTest extends TestCase
{
public function testParse() : void
{
/** @var Parser|PHPUnit_Framework_MockObject_MockObject $wrappedParser */
/** @var Parser|MockObject $wrappedParser */
$wrappedParser = $this->createMock(Parser::class);

$randomCodeStrings = array_unique(array_map(
Expand Down
12 changes: 6 additions & 6 deletions test/unit/SourceLocator/Ast/Strategy/NodeToReflectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use PhpParser\Lexer;
use PhpParser\Node;
use PhpParser\Parser;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject;
use Roave\BetterReflection\Reflection\ReflectionClass;
use Roave\BetterReflection\Reflection\ReflectionFunction;
use Roave\BetterReflection\Reflector\Reflector;
Expand All @@ -33,7 +33,7 @@ private function getFirstAstNodeInString(string $php) : Node

public function testReturnsReflectionForClassNode() : void
{
/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);

$locatedSource = new LocatedSource('<?php class Foo {}', null);
Expand All @@ -51,7 +51,7 @@ public function testReturnsReflectionForClassNode() : void

public function testReturnsReflectionForTraitNode() : void
{
/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);

$locatedSource = new LocatedSource('<?php trait Foo {}', null);
Expand All @@ -70,7 +70,7 @@ public function testReturnsReflectionForTraitNode() : void

public function testReturnsReflectionForInterfaceNode() : void
{
/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);

$locatedSource = new LocatedSource('<?php interface Foo {}', null);
Expand All @@ -89,7 +89,7 @@ public function testReturnsReflectionForInterfaceNode() : void

public function testReturnsReflectionForFunctionNode() : void
{
/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);

$locatedSource = new LocatedSource('<?php function foo(){}', null);
Expand All @@ -107,7 +107,7 @@ public function testReturnsReflectionForFunctionNode() : void

public function testReturnsNullWhenIncompatibleNodeFound() : void
{
/** @var Reflector|PHPUnit_Framework_MockObject_MockObject $reflector */
/** @var Reflector|MockObject $reflector */
$reflector = $this->createMock(Reflector::class);

$locatedSource = new LocatedSource('<?php echo "Hello world";', null);
Expand Down
Loading