Skip to content

Commit

Permalink
chore: Provide DummyPageLayoutView mock for tests
Browse files Browse the repository at this point in the history
This is now excluded from the built package for kohana-view.
  • Loading branch information
acoulton committed Dec 13, 2024
1 parent a45a1c7 commit 8e71be5
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 16 deletions.
5 changes: 1 addition & 4 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
// Require in warden core test bootstrap to autoload mocks and base tests
require_once __DIR__.'/../vendor/ingenerator/warden-core/test/bootstrap.php';

// Require dummy page layout view
require_once __DIR__.'/../vendor/ingenerator/kohana-view/tests/mock/ViewModel/PageLayout/DummyPageLayoutView.php';

// Autoload mocks and test-support helpers that should not autoload in the main app
$mock_loader = new \Composer\Autoload\ClassLoader;
$mock_loader->addPsr4('test\\mock\\Ingenerator\\Warden\\UI\\Kohana\\', [__DIR__.'/mock/']);
$mock_loader->addPsr4('test\\mock\\', [__DIR__.'/mock/']);
$mock_loader->addPsr4('test\\unit\\Ingenerator\\Warden\\UI\\Kohana\\', [__DIR__.'/unit/']);
$mock_loader->register();
10 changes: 10 additions & 0 deletions test/mock/View/DummyPageLayoutView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace test\mock\View;

use Ingenerator\KohanaView\ViewModel\PageLayout\AbstractPageLayoutView;

class DummyPageLayoutView extends AbstractPageLayoutView
{

}
3 changes: 1 addition & 2 deletions test/unit/View/ChangeEmailViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\Core\Entity\SimpleUser;
use Ingenerator\Warden\UI\Kohana\View\ChangeEmailView;
use Ingenerator\Warden\UI\Kohana\View\EmailVerificationView;
use InvalidArgumentException;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class ChangeEmailViewTest extends AbstractFormViewTest
{
Expand Down
4 changes: 1 addition & 3 deletions test/unit/View/ChangePasswordViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\Core\Entity\SimpleUser;
use Ingenerator\Warden\UI\Kohana\View\ChangeEmailView;
use Ingenerator\Warden\UI\Kohana\View\ChangePasswordView;
use Ingenerator\Warden\UI\Kohana\View\EmailVerificationView;
use InvalidArgumentException;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class ChangePasswordViewTest extends AbstractFormViewTest
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/View/EmailVerificationViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\UI\Kohana\View\EmailVerificationView;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class EmailVerificationViewTest extends AbstractFormViewTest
{
Expand Down
4 changes: 2 additions & 2 deletions test/unit/View/LoginViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@


use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\UI\Kohana\View\LoginView;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use Ingenerator\Warden\Core\Support\FixedUrlProviderStub;
use Ingenerator\Warden\UI\Kohana\View\LoginView;
use test\mock\View\DummyPageLayoutView;

class LoginViewTest extends AbstractFormViewTest
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/View/PasswordResetViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\UI\Kohana\View\PasswordResetView;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class PasswordResetViewTest extends AbstractFormViewTest
{
Expand Down
4 changes: 2 additions & 2 deletions test/unit/View/ProfileViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@


use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\UI\Kohana\View\ProfileView;
use Ingenerator\Warden\Core\Entity\SimpleUser;
use Ingenerator\Warden\UI\Kohana\View\ProfileView;
use InvalidArgumentException;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class ProfileViewTest extends \PHPUnit\Framework\TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion test/unit/View/RegistrationViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Ingenerator\KohanaView\ViewModel\PageContentView;
use Ingenerator\Warden\UI\Kohana\Form\Fieldset;
use Ingenerator\Warden\UI\Kohana\View\RegistrationView;
use test\mock\ViewModel\PageLayout\DummyPageLayoutView;
use test\mock\View\DummyPageLayoutView;

class RegistrationViewTest extends AbstractFormViewTest
{
Expand Down

0 comments on commit 8e71be5

Please sign in to comment.