Skip to content

Commit

Permalink
#116 - Add basic Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Sep 16, 2019
1 parent 9b99192 commit e85df21
Show file tree
Hide file tree
Showing 45 changed files with 794 additions and 3 deletions.
18 changes: 18 additions & 0 deletions tests/unit/ApplicationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit;

use Codeception\Test\Unit;
use Vokuro\Application;

final class ApplicationTest extends Unit
{
public function testConstructAndGetRootPath(): void
{
$rootPath = 'test/path';
$class = $this->constructEmptyExcept(Application::class, 'getRootPath', ['rootPath' => $rootPath]);

$this->assertEquals($rootPath, $class->getRootPath());
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/AboutControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\AboutController;

final class AboutControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(AboutController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/ControllerBaseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\ControllerBase;

final class ControllerBaseTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(ControllerBase::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/IndexControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\IndexController;

final class IndexControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(IndexController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/PermissionsControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\PermissionsController;

final class PermissionsControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(PermissionsController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/PrivacyControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\PrivacyController;

final class PrivacyControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(PrivacyController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/ProfilesControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\ProfilesController;

final class ProfilesControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(ProfilesController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/SessionControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\SessionController;

final class SessionControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(SessionController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/TermsControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\TermsController;

final class TermsControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(TermsController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/UserControlControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\UserControlController;

final class UserControlControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(UserControlController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/controllers/UsersControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Controllers;

use Codeception\Test\Unit;
use Phalcon\Mvc\Controller;
use Vokuro\Controllers\UsersController;

final class UsersControllerTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(UsersController::class);

$this->assertInstanceOf(Controller::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/ChangePasswordFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\ChangePasswordForm;

final class ChangePasswordFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(ChangePasswordForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/ForgotPasswordFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\ForgotPasswordForm;

final class ForgotPasswordFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(ForgotPasswordForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/LoginFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\LoginForm;

final class LoginFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(LoginForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/ProfilesFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\ProfilesForm;

final class ProfilesFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(ProfilesForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/SignUpFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\SignUpForm;

final class SignUpFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(SignUpForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/forms/UsersFormTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Forms;

use Codeception\Test\Unit;
use Phalcon\Forms\Form;
use Vokuro\Forms\UsersForm;

final class UsersFormTest extends Unit
{
public function testConstruct(): void
{
$class = $this->make(UsersForm::class);

$this->assertInstanceOf(Form::class, $class);
}
}
5 changes: 2 additions & 3 deletions tests/unit/models/EmailConfirmationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Vokuro\Tests\Unit\Models;

use Codeception\Stub;
use Codeception\Test\Unit;
use Phalcon\Mvc\Model;
use Vokuro\Models\EmailConfirmations;
Expand All @@ -12,8 +11,8 @@ final class EmailConfirmationsTest extends Unit
{
public function testModelInstanceOf(): void
{
$emailConfirmations = Stub::make(EmailConfirmations::class);
$class = $this->make(EmailConfirmations::class);

$this->assertInstanceOf(Model::class, $emailConfirmations);
$this->assertInstanceOf(Model::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/models/FailedLoginsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Models;

use Codeception\Test\Unit;
use Phalcon\Mvc\Model;
use Vokuro\Models\FailedLogins;

final class FailedLoginsTest extends Unit
{
public function testModelInstanceOf(): void
{
$class = $this->make(FailedLogins::class);

$this->assertInstanceOf(Model::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/models/PasswordChangesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Models;

use Codeception\Test\Unit;
use Phalcon\Mvc\Model;
use Vokuro\Models\PasswordChanges;

final class PasswordChangesTest extends Unit
{
public function testModelInstanceOf(): void
{
$class = $this->make(PasswordChanges::class);

$this->assertInstanceOf(Model::class, $class);
}
}
18 changes: 18 additions & 0 deletions tests/unit/models/PermissionsTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);

namespace Vokuro\Tests\Unit\Models;

use Codeception\Test\Unit;
use Phalcon\Mvc\Model;
use Vokuro\Models\Permissions;

final class PermissionsTest extends Unit
{
public function testModelInstanceOf(): void
{
$class = $this->make(Permissions::class);

$this->assertInstanceOf(Model::class, $class);
}
}
Loading

0 comments on commit e85df21

Please sign in to comment.