mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e415e0051a | ||
|
608bcb767b | ||
|
b4e8c27618 | ||
|
d65cdaf028 | ||
|
5f1779c4e7 | ||
|
b10613c5e3 | ||
|
1c3b319aa6 | ||
|
1069507ab4 | ||
|
5ca63c921a | ||
|
943fc1cc82 | ||
|
a158883aed | ||
|
8aba2b29b8 | ||
|
b5e8f9206b | ||
|
755a753cb5 | ||
|
e99211db31 | ||
|
1142f8d86b |
@@ -4,4 +4,5 @@ php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
|
||||
script: phpunit --coverage-text --configuration build/phpunit.xml
|
||||
before_script: composer install
|
||||
script: phpunit -c build/phpunit.xml
|
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit colors="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false">
|
||||
<phpunit colors="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnError="false" stopOnFailure="false" stopOnIncomplete="false" stopOnSkipped="false" bootstrap="../tests/Bootstrap.php">
|
||||
<testsuites>
|
||||
<testsuite name="Authentication Server">
|
||||
<directory suffix="test.php">../tests/authentication</directory>
|
||||
@@ -17,7 +17,8 @@
|
||||
</blacklist>
|
||||
</filter>
|
||||
<logging>
|
||||
<log type="coverage-html" target="coverage" title="lncd/OAuth" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
|
||||
<log type="coverage-html" target="coverage" title="lncd/OAuth" charset="UTF-8" yui="true" highlight="true" lowUpperBound="50" highLowerBound="90"/>
|
||||
<log type="coverage-text" target="php://stdout" title="lncd/OAuth" charset="UTF-8" yui="true" highlight="true" lowUpperBound="50" highLowerBound="90"/>
|
||||
<log type="coverage-clover" target="logs/clover.xml"/>
|
||||
<log type="junit" target="logs/junit.xml" logIncompleteSkipped="false"/>
|
||||
</logging>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "lncd/oauth2",
|
||||
"description": "OAuth 2.0 Framework",
|
||||
"version": "0.4",
|
||||
"version": "0.4.2",
|
||||
"homepage": "https://github.com/lncd/OAuth2",
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
|
@@ -148,7 +148,7 @@ class Server
|
||||
|
||||
if (isset($headers['Authorization'])) {
|
||||
|
||||
$rawToken = trim(str_replace('Bearer', '', $headers['Authorization']));
|
||||
$rawToken = base64_decode(str_replace('Bearer ', '', trim($headers['Authorization'])));
|
||||
|
||||
if ( ! empty($rawToken)) {
|
||||
$accessToken = $rawToken;
|
||||
@@ -250,4 +250,4 @@ class Server
|
||||
|
||||
return call_user_func_array(array($this->_db, $method), $params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
6
tests/Bootstrap.php
Normal file
6
tests/Bootstrap.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
if ( ! @include_once __DIR__ . '/../vendor/autoload.php')
|
||||
{
|
||||
exit("You must set up the project dependencies, run the following commands:\n> wget http://getcomposer.org/composer.phar\n> php composer.phar install\n");
|
||||
}
|
@@ -4,9 +4,6 @@ class Authentication_Server_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
require_once 'src/OAuth2/Authentication/Server.php';
|
||||
require_once 'src/OAuth2/Authentication/Database.php';
|
||||
|
||||
$this->oauth = new Oauth2\Authentication\Server();
|
||||
|
||||
require_once 'database_mock.php';
|
||||
|
@@ -4,9 +4,6 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp()
|
||||
{
|
||||
require_once 'src/OAuth2/Resource/Server.php';
|
||||
require_once 'src/OAuth2/Resource/Database.php';
|
||||
|
||||
require_once('database_mock.php');
|
||||
$this->server = new Oauth2\Resource\Server();
|
||||
$this->db = new ResourceDB();
|
||||
|
Reference in New Issue
Block a user