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

Make unit tests PSR-4 compliant #45

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"spatie/macroable": "^1.0",
"mindplay/middleman": "^3.0.3",
"psr/log": "^1.1",
"laminas/laminas-zendframework-bridge": "^1.4"
"laminas/laminas-zendframework-bridge": "^1.4",
"phpstan/phpstan": "^1.10"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
Expand All @@ -44,5 +45,10 @@
"psr-4": {
"Rareloop\\Lumberjack\\Test\\": "tests"
}
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Providers\ServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use phpmock\Mock;
use phpmock\MockBuilder;
use Brain\Monkey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Exceptions\Handler;
use Rareloop\Lumberjack\Exceptions\HandlerInterface;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Zend\Diactoros\Response;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rareloop\Lumberjack\Test\Unit;
namespace Rareloop\Lumberjack\Test;

use Brain\Monkey;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Facades\Session;
use Rareloop\Lumberjack\Session\SessionManager;
use Rareloop\Lumberjack\Test\Unit\Session\NullSessionHandler;
use Rareloop\Lumberjack\Test\Session\NullSessionHandler;

class SessionTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GlobalFunctionsTest extends TestCase

public function setUp(): void
{
include_once(__DIR__ . '/../../src/functions.php');
include_once(__DIR__ . '/../src/functions.php');

parent::setUp();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion tests/Unit/LumberjackTest.php → tests/LumberjackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Rareloop\Lumberjack\Bootstrappers\RegisterProviders;
use Rareloop\Lumberjack\Bootstrappers\RegisterRequestHandler;
use Rareloop\Lumberjack\Http\Lumberjack;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;

class LumberjackTest extends TestCase
{
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/PageTest.php → tests/PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Page;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;

class PageTest extends TestCase
{
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/Unit/PostTest.php → tests/PostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Post;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Timber\Timber;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Providers;

use Brain\Monkey\Functions;
use Mockery;
Expand All @@ -9,7 +9,7 @@
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Post;
use Rareloop\Lumberjack\Providers\CustomPostTypesServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class CustomPostTypesServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Rareloop\Lumberjack\Contracts\Encrypter as EncrypterContract;
use Rareloop\Lumberjack\Encrypter;
use Rareloop\Lumberjack\Providers\EncryptionServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class EncryptionServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Providers;

use Brain\Monkey\Functions;
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Providers\ImageSizesServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class ImageSizesServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Rareloop\Lumberjack\Bootstrappers\RegisterProviders;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Http\Lumberjack;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class LogServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Providers;

use Brain\Monkey\Functions;
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Providers\MenusServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class MenusServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Rareloop\Lumberjack\Http\Lumberjack;
use Rareloop\Lumberjack\Http\Router;
use Rareloop\Lumberjack\Providers\RouterServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\MiddlewareResolver;
use Zend\Diactoros\Request;
use Zend\Diactoros\Response\HtmlResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Providers\ServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class ServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Providers\SessionServiceProvider;
use Rareloop\Lumberjack\Session\SessionManager;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class SessionServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Providers;

use Brain\Monkey\Functions;
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Providers\ThemeSupportServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;

class ThemeSupportServiceProviderTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Rareloop\Lumberjack\Config;
use Rareloop\Lumberjack\Http\Lumberjack;
use Rareloop\Lumberjack\Providers\TimberServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;
use Timber\Timber;

class TimberServiceProviderTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
use Rareloop\Lumberjack\Http\MiddlewareResolver;
use Rareloop\Lumberjack\Providers\RouterServiceProvider;
use Rareloop\Lumberjack\Providers\WordPressControllersServiceProvider;
use Rareloop\Lumberjack\Test\Unit\BrainMonkeyPHPUnitIntegration;
use Rareloop\Lumberjack\Test\BrainMonkeyPHPUnitIntegration;
use Rareloop\Router\Responsable;
use Zend\Diactoros\Response\TextResponse;
use Zend\Diactoros\ServerRequest;
use \Mockery;
use Mockery;

class WordPressControllersServiceProviderTest extends TestCase
{
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Session;

use Dcrypt\AesCbc;
use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Encrypter;
use Rareloop\Lumberjack\Session\EncryptedStore;
use Rareloop\Lumberjack\Session\Store;
use Rareloop\Lumberjack\Test\Unit\Session\NullSessionHandler;

class EncryptedStoreTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Session;

use Mockery;
use PHPUnit\Framework\TestCase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rareloop\Lumberjack\Test\Unit\Session;
namespace Rareloop\Lumberjack\Test\Session;

use SessionHandlerInterface;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Session;

use Mockery;
use PHPUnit\Framework\TestCase;
Expand All @@ -12,7 +12,6 @@
use Rareloop\Lumberjack\Session\FileSessionHandler;
use Rareloop\Lumberjack\Session\SessionManager;
use Rareloop\Lumberjack\Session\Store;
use Rareloop\Lumberjack\Test\Unit\Session\NullSessionHandler;
use org\bovigo\vfs\vfsStream;

class SessionManagerTest extends TestCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Rareloop\Lumberjack\Test;
namespace Rareloop\Lumberjack\Test\Session;

use Mockery;
use PHPUnit\Framework\TestCase;
use Rareloop\Lumberjack\Session\Store;
use Rareloop\Lumberjack\Test\Unit\Session\NullSessionHandler;
use Rareloop\Lumberjack\Test\Session\NullSessionHandler;

class StoreTest extends TestCase
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.