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

tidy: avoids require #1218

Merged
merged 1 commit into from
Apr 15, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Mockery/Fixtures/SemiReservedWordsAsMethods.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Mockery\Fixtures;
namespace test\Mockery\Fixtures;

class SemiReservedWordsAsMethods
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Mockery;

use Mockery as m;
use Mockery\Fixtures\SemiReservedWordsAsMethods;
use test\Mockery\Fixtures\SemiReservedWordsAsMethods;
use PHPUnit\Framework\TestCase;

class MockeryCanMockClassesWithSemiReservedWordsTest extends TestCase
Expand All @@ -13,9 +13,7 @@ class MockeryCanMockClassesWithSemiReservedWordsTest extends TestCase
*/
public function smoke_test()
{
require __DIR__ . '/Fixtures/SemiReservedWordsAsMethods.php';

$mock = m::mock("Mockery\Fixtures\SemiReservedWordsAsMethods");
$mock = m::mock(SemiReservedWordsAsMethods::class);

$mock->shouldReceive("include")->andReturn("foo");

Expand Down
5 changes: 2 additions & 3 deletions tests/Mockery/MockingAllLowerCasedMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@

namespace test\Mockery;

use test\Mockery\Fixtures\ClassWithAllLowerCaseMethod;
use Mockery\Adapter\Phpunit\MockeryTestCase;

class MockingAllLowerCasedMethodsTest extends MockeryTestCase
{
/** @test */
public function itShouldAllowToCallAllLowerCasedMethodAsCamelCased()
{
require __DIR__ . "/Fixtures/ClassWithAllLowerCaseMethod.php";

$mock = mock('test\Mockery\Fixtures\ClassWithAllLowerCaseMethod');
$mock = mock(ClassWithAllLowerCaseMethod::class);
$mock->shouldReceive('userExpectsCamelCaseMethod')
->andReturn('mocked');

Expand Down
4 changes: 2 additions & 2 deletions tests/Mockery/MockingMethodsWithIterableTypeHintsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

namespace test\Mockery;

use test\Mockery\Fixtures\MethodWithIterableTypeHints;
use Mockery\Adapter\Phpunit\MockeryTestCase;

class MockingMethodsWithIterableTypeHintsTest extends MockeryTestCase
{
/** @test */
public function itShouldSuccessfullyBuildTheMock()
{
require __DIR__ . "/Fixtures/MethodWithIterableTypeHints.php";
$mock = mock("test\Mockery\Fixtures\MethodWithIterableTypeHints");
$mock = mock(MethodWithIterableTypeHints::class);

$this->assertInstanceOf(\test\Mockery\Fixtures\MethodWithIterableTypeHints::class, $mock);
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Mockery/MockingMethodsWithNullableParametersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@

namespace test\Mockery;

use test\Mockery\Fixtures\MethodWithNullableReturnType;
use test\Mockery\Fixtures\MethodWithParametersWithDefaultValues;
use Mockery\Adapter\Phpunit\MockeryTestCase;

class MockingMethodsWithNullableParametersTest extends MockeryTestCase
{
/** @test */
public function it_can_handle_nullable_typed_parameters()
{
require __DIR__ . "/Fixtures/MethodWithNullableTypedParameter.php";
$mock = mock("test\Mockery\Fixtures\MethodWithNullableTypedParameter");
$mock = mock(MethodWithNullableTypedParameter::class);

$this->assertInstanceOf(\test\Mockery\Fixtures\MethodWithNullableTypedParameter::class, $mock);
$this->assertInstanceOf(MethodWithNullableTypedParameter::class, $mock);
}

/** @test */
public function it_can_handle_default_parameters()
{
require __DIR__ . "/Fixtures/MethodWithParametersWithDefaultValues.php";
$mock = mock("test\Mockery\Fixtures\MethodWithParametersWithDefaultValues");
$mock = mock(MethodWithParametersWithDefaultValues::class);

$this->assertInstanceOf(\test\Mockery\Fixtures\MethodWithParametersWithDefaultValues::class, $mock);
$this->assertInstanceOf(MethodWithParametersWithDefaultValues::class, $mock);
}
}