-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
89 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="CakePHP Sentry"> | ||
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer" /> | ||
|
||
<rule ref="CakePHP" /> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
src/Authentication/Authenticator/ProvisoryTokenAuthenticator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
tests/TestCase/Authentication/Authenticator/ProvisoryTokenAuthenticatorTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Cake\Core\Configure; | ||
use Cake\Core\Plugin; | ||
use Cake\Datasource\ConnectionManager; | ||
use Cake\Routing\Router; | ||
use Cake\Utility\Security; | ||
|
||
$findRoot = function ($root) { | ||
do { | ||
$lastRoot = $root; | ||
$root = dirname($root); | ||
if (is_dir($root . '/vendor/cakephp/cakephp')) { | ||
return $root; | ||
} | ||
} while ($root !== $lastRoot); | ||
throw new Exception('Cannot find the root of the application, unable to run tests'); | ||
}; | ||
$root = $findRoot(__FILE__); | ||
unset($findRoot); | ||
chdir($root); | ||
|
||
//require_once 'vendor/cakephp/cakephp/src/functions.php'; | ||
//require_once 'vendor/autoload.php'; | ||
|
||
define('ROOT', $root . DS . 'tests' . DS . 'test_app' . DS); | ||
// define('APP', ROOT . 'App' . DS); | ||
// define('TMP', sys_get_temp_dir() . DS); | ||
define('CONFIG', ROOT . DS . 'config' . DS); | ||
|
||
Configure::write('debug', true); | ||
Configure::write( | ||
'App', [ | ||
'namespace' => 'TestApp', | ||
'encoding' => 'UTF-8', | ||
'paths' => [ | ||
'plugins' => [ROOT . 'Plugin' . DS], | ||
'templates' => [ROOT . 'templates' . DS], | ||
], | ||
] | ||
); | ||
|
||
ConnectionManager::setConfig( | ||
'test', [ | ||
'className' => 'Cake\Database\Connection', | ||
'driver' => 'Cake\Database\Driver\Sqlite', | ||
'database' => ':memory:', | ||
'encoding' => 'utf8', | ||
'timezone' => 'UTC', | ||
'quoteIdentifiers' => false, | ||
] | ||
); | ||
|
||
Router::reload(); | ||
//Security::setSalt('rrd'); | ||
|
||
Plugin::getCollection()->add(new \Authentication\Plugin()); | ||
|
||
$_SERVER['PHP_SELF'] = '/'; | ||
|
||
Configure::load('ApiTokenAuthenticator.apiTokenAuthenticator'); | ||
|
||
use Cake\TestSuite\Fixture\SchemaLoader; | ||
// Load a schema dump file. | ||
|
||
(new SchemaLoader())->loadSqlFiles('tests/schema.sql', 'test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
return [ | ||
'ApiTokenAuthenticator' => [] | ||
'ApiTokenAuthenticator' => [], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace TestApp\Controller; | ||
|
Oops, something went wrong.