OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
/
vendor
/
lcobucci
/
jwt
/
test
/
unit
/
Token
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/12/2024 10:35:52 AM
rwxr-xr-x
📄
BuilderTest.php
4.67 KB
08/12/2024 10:35:52 AM
rw-r--r--
📄
DataSetTest.php
2.32 KB
08/12/2024 10:35:52 AM
rw-r--r--
📄
ParserTest.php
19.33 KB
08/12/2024 10:35:52 AM
rw-r--r--
📄
PlainTest.php
15.97 KB
08/12/2024 10:35:52 AM
rw-r--r--
📄
SignatureTest.php
970 bytes
08/12/2024 10:35:52 AM
rw-r--r--
Editing: DataSetTest.php
Close
<?php declare(strict_types=1); namespace Lcobucci\JWT\Token; use PHPUnit\Framework\TestCase; /** @coversDefaultClass \Lcobucci\JWT\Token\DataSet */ final class DataSetTest extends TestCase { /** * @test * * @covers ::__construct * @covers ::get * * @uses \Lcobucci\JWT\Token\DataSet::has */ public function getShouldReturnTheConfiguredValue(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertSame(1, $set->get('one')); } /** * @test * * @covers ::__construct * @covers ::get * * @uses \Lcobucci\JWT\Token\DataSet::has */ public function getShouldReturnTheFallbackValueWhenItWasGiven(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertSame(2, $set->get('two', 2)); } /** * @test * * @covers ::__construct * @covers ::get * * @uses \Lcobucci\JWT\Token\DataSet::has */ public function getShouldReturnNullWhenFallbackValueWasNotGiven(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertNull($set->get('two')); } /** * @test * * @covers ::__construct * @covers ::has */ public function hasShouldReturnTrueWhenItemWasConfigured(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertTrue($set->has('one')); } /** * @test * * @covers ::__construct * @covers ::has */ public function hasShouldReturnFalseWhenItemWasNotConfigured(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertFalse($set->has('two')); } /** * @test * * @covers ::__construct * @covers ::all */ public function allShouldReturnAllConfiguredItems(): void { $items = ['one' => 1, 'two' => 2]; $set = new DataSet($items, 'one=1'); self::assertSame($items, $set->all()); } /** * @test * * @covers ::__construct * @covers ::toString */ public function toStringShouldReturnTheEncodedData(): void { $set = new DataSet(['one' => 1], 'one=1'); self::assertSame('one=1', $set->toString()); } }