This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
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
2 changed files
with
45 additions
and
0 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,41 @@ | ||
<?php | ||
/** | ||
* @see https://github.com/zendframework/zend-expressive-authentication-oauth2 for the canonical source repository | ||
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com) | ||
* @license https://github.com/zendframework/zend-expressive-authentication-oauth2/blob/master/LICENSE.md | ||
* New BSD License | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ZendTest\Expressive\Authentication\OAuth2\Repository\Pdo; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Zend\Expressive\Authentication\OAuth2\Repository\Pdo\AbstractRepository; | ||
use Zend\Expressive\Authentication\OAuth2\Repository\Pdo\PdoService; | ||
|
||
class AbstractRepositoryTest extends TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->pdo = $this->prophesize(PdoService::class); | ||
} | ||
|
||
public function testConstructor() | ||
{ | ||
$abstract = new AbstractRepository($this->pdo->reveal()); | ||
$this->assertInstanceOf(AbstractRepository::class, $abstract); | ||
} | ||
|
||
public function testScopesToString() | ||
{ | ||
$proxy = new class($this->pdo->reveal()) extends AbstractRepository { | ||
public function scopesToString(array $scopes): string | ||
{ | ||
return parent::scopesToString($scopes); | ||
} | ||
}; | ||
$result = $proxy->scopesToString([]); | ||
$this->assertEquals('', $result); | ||
} | ||
} |