Skip to content

Commit

Permalink
Rename test double API traits
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 28, 2019
1 parent 28b0458 commit 7b4c302
Show file tree
Hide file tree
Showing 55 changed files with 105 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @internal This trait is not covered by the backward compatibility promise for PHPUnit
*/
trait TestDoubleApi
trait Api
{
/**
* @var ConfigurableMethod[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @internal This trait is not covered by the backward compatibility promise for PHPUnit
*/
trait TestDoubleApiMethod
trait Method
{
public function method()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ private function generateMock($type, ?array $explicitMethods, string $mockClassN
$method = '';

if (!$mockMethods->hasMethod('method') && (!isset($class) || !$class->hasMethod('method'))) {
$method = \PHP_EOL . ' use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;';
$method = \PHP_EOL . ' use \PHPUnit\Framework\MockObject\Method;';
}

$classTemplate->setVar(
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Generator/mocked_class.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ declare(strict_types=1);

{prologue}{class_declaration}
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;{method}
use \PHPUnit\Framework\MockObject\Api;{method}

{clone}{mocked_methods}}{epilogue}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
namespace PHPUnit\TestFixture\MockObject;

use PHPUnit\Framework\MockObject\TestDoubleApi;
use PHPUnit\Framework\MockObject\Api;

class AnotherClassUsingConfigurableMethods
{
use TestDoubleApi;
use Api;

public static function getConfigurableMethods(): array
{
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/mock-object/ClassUsingConfigurableMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
namespace PHPUnit\TestFixture\MockObject;

use PHPUnit\Framework\MockObject\TestDoubleApi;
use PHPUnit\Framework\MockObject\Api;

class ClassUsingConfigurableMethods
{
use TestDoubleApi;
use Api;

public static function getConfigurableMethods(): array
{
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/mock-object/MockClassGenerated.tpl.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace PHPUnit\TestFixture\MockObject;

use PHPUnit\Framework\MockObject\TestDoubleApi;
use PHPUnit\Framework\MockObject\Api;

class MockClassGenerated
{
use TestDoubleApi;
use Api;

public static function getConfigurableMethods(): array
{
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/mock-object/MockClassWithConfigurableMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
*/
namespace PHPUnit\TestFixture\MockObject;

use PHPUnit\Framework\MockObject\TestDoubleApi;
use PHPUnit\Framework\MockObject\Api;

class MockClassWithConfigurableMethods
{
use TestDoubleApi;
use Api;

public static function getConfigurableMethods(): array
{
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/mock-object/ReinitializeConfigurableMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
*/
namespace PHPUnit\TestFixture\MockObject;

use PHPUnit\Framework\MockObject\TestDoubleApi;
use PHPUnit\Framework\MockObject\Api;

class ReinitializeConfigurableMethods
{
use TestDoubleApi;
use Api;
}
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/232.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ declare(strict_types=1);

class Issue3154Mock extends Is\Namespaced\Issue3154 implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/397.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockC extends C implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/abstract_class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/class_partial.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ declare(strict_types=1);

class MockFoo extends ClassWithDeprecatedMethod implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends ClassWithFinalMethod implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\Api;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends ClassWithMethodWithNullableTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends ClassWithMethodWithTypehintedVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends ClassWithMethodWithVariadicArguments implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/interface.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ declare(strict_types=1);

class MockFoo implements PHPUnit\Framework\MockObject\MockObject, Foo
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ declare(strict_types=1);

class MockFoo extends Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/mock-objects/generator/namespaced_class.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ declare(strict_types=1);

class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declare(strict_types=1);

class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declare(strict_types=1);

class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declare(strict_types=1);

class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ declare(strict_types=1);

class MockFoo extends NS\Foo implements PHPUnit\Framework\MockObject\MockObject
{
use \PHPUnit\Framework\MockObject\TestDoubleApi;
use \PHPUnit\Framework\MockObject\TestDoubleApiMethod;
use \PHPUnit\Framework\MockObject\Api;
use \PHPUnit\Framework\MockObject\Method;

public function __clone()
{
Expand Down

0 comments on commit 7b4c302

Please sign in to comment.