Skip to content

Commit

Permalink
Rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Apr 15, 2022
1 parent 06292af commit add6754
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 38 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ The main idea is simple: register Listener of PHPUnit and call Mocker at first.

use PHPUnit\Runner\BeforeTestHook;
use PHPUnit\Runner\BeforeFirstTestHook;
use Xepozz\InternalFunctionMocker\Mocker;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\Mocker;
use Xepozz\InternalMocker\MockerState;

final class MockerExtension implements BeforeTestHook, BeforeFirstTestHook
{
Expand Down Expand Up @@ -112,7 +112,7 @@ class ServiceTest extends TestCase
```

See full example
in [`\Xepozz\InternalFunctionMocker\Tests\Integration\DateTimeTest::testRun2`](tests/Integration/DateTimeTest.php)
in [`\Xepozz\InternalMocker\Tests\Integration\DateTimeTest::testRun2`](tests/Integration/DateTimeTest.php)

#### Pre-defined mock

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "xepozz/internal-function-mock",
"name": "xepozz/internal-mocker",
"type": "library",
"autoload": {
"psr-4": {
"Xepozz\\InternalFunctionMocker\\": "src/"
"Xepozz\\InternalMocker\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Xepozz\\InternalFunctionMocker\\Tests\\": "tests/"
"Xepozz\\InternalMocker\\Tests\\": "tests/"
}
},
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
resolveDependencies="true">

<extensions>
<extension class="Xepozz\InternalFunctionMocker\Tests\Listener"/>
<extension class="Xepozz\InternalMocker\Tests\Listener"/>
</extensions>
<php>
<ini name="error_reporting" value="-1"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Mocker.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker;
namespace Xepozz\InternalMocker;

use Yiisoft\VarDumper\VarDumper;

Expand Down
2 changes: 1 addition & 1 deletion src/MockerState.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker;
namespace Xepozz\InternalMocker;

final class MockerState
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/DateTime.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;

class DateTime
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/DateTimeTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;

use PHPUnit\Framework\TestCase;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\MockerState;

final class DateTimeTest extends TestCase
{
Expand All @@ -20,7 +20,7 @@ public function testRun2()
$obj = new DateTime();

MockerState::addCondition(
'Xepozz\InternalFunctionMocker\Tests\Integration',
'Xepozz\InternalMocker\Tests\Integration',
'time',
[],
100
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/StrContains.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;

class StrContains
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/StrContainsTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;

use PHPUnit\Framework\TestCase;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\MockerState;

class StrContainsTest extends TestCase
{
Expand Down Expand Up @@ -34,7 +34,7 @@ public function testRun4()
$obj = new StrContains();

MockerState::addCondition(
'Xepozz\InternalFunctionMocker\Tests\Integration',
'Xepozz\InternalMocker\Tests\Integration',
'str_contains',
['string4', 'str'],
false
Expand Down
12 changes: 6 additions & 6 deletions tests/Listener.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests;
namespace Xepozz\InternalMocker\Tests;

use PHPUnit\Runner\BeforeFirstTestHook;
use PHPUnit\Runner\BeforeTestHook;
use Xepozz\InternalFunctionMocker\Mocker;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\Mocker;
use Xepozz\InternalMocker\MockerState;

final class Listener implements BeforeFirstTestHook, BeforeTestHook
{
public function executeBeforeFirstTest(): void
{
$mocks = [
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'time',
'result' => 555,
'arguments' => [],
],
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'str_contains',
'result' => false,
'arguments' => [
Expand All @@ -29,7 +29,7 @@ public function executeBeforeFirstTest(): void
],
],
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'str_contains',
'result' => false,
'arguments' => [
Expand Down
30 changes: 15 additions & 15 deletions tests/MockerTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
declare(strict_types=1);

namespace Xepozz\InternalFunctionMocker\Tests;
namespace Xepozz\InternalMocker\Tests;

use PHPUnit\Framework\TestCase;
use Xepozz\InternalFunctionMocker\Mocker;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\Mocker;
use Xepozz\InternalMocker\MockerState;

final class MockerTest extends TestCase
{
Expand All @@ -26,25 +26,25 @@ public function generateProvider()
[
[
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'time',
'result' => 555,
'arguments' => [],
],
],
<<<PHP
namespace Xepozz\InternalFunctionMocker;
namespace Xepozz\InternalMocker;
MockerState::addCondition(
"Xepozz\InternalFunctionMocker\Tests\Integration",
"Xepozz\InternalMocker\Tests\Integration",
"time",
[],
555
);
namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\MockerState;
function time(...\$arguments)
{
Expand All @@ -58,7 +58,7 @@ function time(...\$arguments)
[
[
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'str_contains',
'result' => false,
'arguments' => [
Expand All @@ -67,7 +67,7 @@ function time(...\$arguments)
],
],
[
'namespace' => 'Xepozz\InternalFunctionMocker\Tests\Integration',
'namespace' => 'Xepozz\InternalMocker\Tests\Integration',
'name' => 'str_contains',
'result' => false,
'arguments' => [
Expand All @@ -77,24 +77,24 @@ function time(...\$arguments)
],
],
<<<PHP
namespace Xepozz\InternalFunctionMocker;
namespace Xepozz\InternalMocker;
MockerState::addCondition(
"Xepozz\InternalFunctionMocker\Tests\Integration",
"Xepozz\InternalMocker\Tests\Integration",
"str_contains",
['haystack' => 'string','needle' => 'str'],
false
);
MockerState::addCondition(
"Xepozz\InternalFunctionMocker\Tests\Integration",
"Xepozz\InternalMocker\Tests\Integration",
"str_contains",
['haystack' => 'string2','needle' => 'str'],
false
);
namespace Xepozz\InternalFunctionMocker\Tests\Integration;
namespace Xepozz\InternalMocker\Tests\Integration;
use Xepozz\InternalFunctionMocker\MockerState;
use Xepozz\InternalMocker\MockerState;
function str_contains(...\$arguments)
{
Expand Down

0 comments on commit add6754

Please sign in to comment.