GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 29-29 lines in 3 locations

test/Algorithm/Hs256Test.php 1 location

@@ 5-33 (lines=29) @@
2
3
namespace Emarref\Jwt\Algorithm;
4
5
class Hs256Test extends \PHPUnit_Framework_TestCase
6
{
7
    const ALGORITHM = 'sha256';
8
9
    private static $name   = 'HS256';
10
    private static $secret = 'secret';
11
12
    /**
13
     * @var Hs256
14
     */
15
    private $algorithm;
16
17
    public function setUp()
18
    {
19
        $this->algorithm = new Hs256(self::$secret);
20
    }
21
22
    public function testGetName()
23
    {
24
        $this->assertSame(self::$name, $this->algorithm->getName());
25
    }
26
27
    public function testCompute()
28
    {
29
        $unencryptedValue = 'foobar';
30
        $encryptedValue   = hash_hmac(self::ALGORITHM, $unencryptedValue, self::$secret, true);
31
        $this->assertSame($encryptedValue, $this->algorithm->compute($unencryptedValue));
32
    }
33
}
34

test/Algorithm/Hs384Test.php 1 location

@@ 5-33 (lines=29) @@
2
3
namespace Emarref\Jwt\Algorithm;
4
5
class Hs384Test extends \PHPUnit_Framework_TestCase
6
{
7
    const ALGORITHM = 'sha384';
8
9
    private static $name   = 'HS384';
10
    private static $secret = 'secret';
11
12
    /**
13
     * @var Hs384
14
     */
15
    private $algorithm;
16
17
    public function setUp()
18
    {
19
        $this->algorithm = new Hs384(self::$secret);
20
    }
21
22
    public function testGetName()
23
    {
24
        $this->assertSame(self::$name, $this->algorithm->getName());
25
    }
26
27
    public function testCompute()
28
    {
29
        $unencryptedValue = 'foobar';
30
        $encryptedValue   = hash_hmac(self::ALGORITHM, $unencryptedValue, self::$secret, true);
31
        $this->assertSame($encryptedValue, $this->algorithm->compute($unencryptedValue));
32
    }
33
}
34

test/Algorithm/Hs512Test.php 1 location

@@ 5-33 (lines=29) @@
2
3
namespace Emarref\Jwt\Algorithm;
4
5
class Hs512Test extends \PHPUnit_Framework_TestCase
6
{
7
    const ALGORITHM = 'sha512';
8
9
    private static $name   = 'HS512';
10
    private static $secret = 'secret';
11
12
    /**
13
     * @var Hs512
14
     */
15
    private $algorithm;
16
17
    public function setUp()
18
    {
19
        $this->algorithm = new Hs512(self::$secret);
20
    }
21
22
    public function testGetName()
23
    {
24
        $this->assertSame(self::$name, $this->algorithm->getName());
25
    }
26
27
    public function testCompute()
28
    {
29
        $unencryptedValue = 'foobar';
30
        $encryptedValue   = hash_hmac(self::ALGORITHM, $unencryptedValue, self::$secret, true);
31
        $this->assertSame($encryptedValue, $this->algorithm->compute($unencryptedValue));
32
    }
33
}
34