Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
a4c5004bd8 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,6 +1,3 @@
|
|||||||
# Composer
|
# Composer
|
||||||
/vendor/
|
/vendor/
|
||||||
composer.lock
|
composer.lock
|
||||||
|
|
||||||
# PHPUnit
|
|
||||||
.phpunit.result.*
|
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Contract;
|
namespace App\Contract;
|
||||||
|
|
||||||
|
use App\Definition\Contract;
|
||||||
use App\Service\Auth as AuthService;
|
use App\Service\Auth as AuthService;
|
||||||
|
|
||||||
class Auth
|
class Auth
|
||||||
{
|
{
|
||||||
|
use Contract;
|
||||||
|
|
||||||
protected static function newInstance()
|
protected static function newInstance()
|
||||||
{
|
{
|
||||||
return new AuthService();
|
return new AuthService();
|
||||||
}
|
}
|
||||||
protected static $instance;
|
|
||||||
protected static function getInstance() {
|
|
||||||
if (self::$instance === null) {
|
|
||||||
self::$instance = self::newInstance();
|
|
||||||
}
|
|
||||||
return self::$instance;
|
|
||||||
}
|
|
||||||
public static function __callStatic($name, $params)
|
public static function __callStatic($name, $params)
|
||||||
{
|
{
|
||||||
if (!method_exists(Response::class, $name)) {
|
if (!method_exists(Response::class, $name)) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"nesbot/carbon": "^2.45"
|
"aldarien/contract": "^1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^8"
|
"phpunit/phpunit": "^8"
|
||||||
|
10
phpunit.xml
10
phpunit.xml
@ -1,10 +0,0 @@
|
|||||||
<phpunit
|
|
||||||
colors="true"
|
|
||||||
verbose="true"
|
|
||||||
>
|
|
||||||
<testsuites>
|
|
||||||
<testsuite name="Config Tests">
|
|
||||||
<directory>tests</directory>
|
|
||||||
</testsuite>
|
|
||||||
</testsuites>
|
|
||||||
</phpunit>
|
|
@ -1,9 +0,0 @@
|
|||||||
<?php
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
use App\contract\Auth;
|
|
||||||
|
|
||||||
class ContractTest extends TestCase {
|
|
||||||
public function testContract() {
|
|
||||||
Auth::logout();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
use PHPUnit\Framework\TestCase;
|
|
||||||
use App\Service\Auth;
|
|
||||||
|
|
||||||
class ServiceTest extends TestCase {
|
|
||||||
public function testLoad() {
|
|
||||||
$this->service = new Auth();
|
|
||||||
$this->assertTrue($this->service != false);
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user