Bläddra i källkod

Wesmiler 人人车 初始化项目 0816

APPLE 3 år sedan
förälder
incheckning
d6e3c32735
34 ändrade filer med 8 tillägg och 3808 borttagningar
  1. 0 5
      vendor/lcobucci/jwt/test/functional/ecdsa/private.key
  2. 0 30
      vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key
  3. 0 9
      vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key
  4. 0 28
      vendor/lcobucci/jwt/test/functional/rsa/private.key
  5. 0 9
      vendor/lcobucci/jwt/test/functional/rsa/public.key
  6. 0 633
      vendor/lcobucci/jwt/test/unit/BuilderTest.php
  7. 0 84
      vendor/lcobucci/jwt/test/unit/Claim/BasicTest.php
  8. 0 83
      vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php
  9. 0 168
      vendor/lcobucci/jwt/test/unit/Claim/FactoryTest.php
  10. 0 107
      vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php
  11. 0 107
      vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php
  12. 0 244
      vendor/lcobucci/jwt/test/unit/ParserTest.php
  13. 0 56
      vendor/lcobucci/jwt/test/unit/Parsing/DecoderTest.php
  14. 0 53
      vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php
  15. 0 73
      vendor/lcobucci/jwt/test/unit/SignatureTest.php
  16. 0 128
      vendor/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php
  17. 0 127
      vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/MultibyteStringConverterTest.php
  18. 0 60
      vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php
  19. 0 60
      vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha384Test.php
  20. 0 60
      vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha512Test.php
  21. 0 117
      vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php
  22. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha256Test.php
  23. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha384Test.php
  24. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php
  25. 0 134
      vendor/lcobucci/jwt/test/unit/Signer/HmacTest.php
  26. 0 119
      vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php
  27. 0 49
      vendor/lcobucci/jwt/test/unit/Signer/KeychainTest.php
  28. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha256Test.php
  29. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php
  30. 0 39
      vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha512Test.php
  31. 0 188
      vendor/lcobucci/jwt/test/unit/Signer/RsaTest.php
  32. 0 573
      vendor/lcobucci/jwt/test/unit/TokenTest.php
  33. 0 270
      vendor/lcobucci/jwt/test/unit/ValidationDataTest.php
  34. 8 0
      vendor/qeq66/jwt/test/functional/ecdsa/private2.key

+ 0 - 5
vendor/lcobucci/jwt/test/functional/ecdsa/private.key

@@ -1,5 +0,0 @@
------BEGIN EC PRIVATE KEY-----
-MHcCAQEEIBGpMoZJ64MMSzuo5JbmXpf9V4qSWdLIl/8RmJLcfn/qoAoGCCqGSM49
-AwEHoUQDQgAE7it/EKmcv9bfpcV1fBreLMRXxWpnd0wxa2iFruiI2tsEdGFTLTsy
-U+GeRqC7zN0aTnTQajarUylKJ3UWr/r1kg==
------END EC PRIVATE KEY-----

+ 0 - 30
vendor/lcobucci/jwt/test/functional/rsa/encrypted-private.key

@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: AES-128-CBC,0D71668CE71033CB9150ED82FC87F4A1
-
-uLzPNDdlHnZ77tAGMHyPYERDMBcdV4SsQJYcSjiHhR2o0dLGTdgOpQrXTHPX4GJF
-LlEWLhAAV9wx2mM/2kHDWB4uZwThtT9/v+RFoW1WbVO/d3lhI9fg4/73/DWAH/7/
-afMRc7ZOVoAmVCESotPx4khCHoE97RdY/JtkLTzc3+peqmL53AbYXrg9rTN1B+ZV
-U3w4ciQS8Uki87zDYIBjYtaOCyMUTvug25CvdssvUMBoc/Jc0xps6/vAyXrnzlGT
-pZD0Tst8idswfDi613BhAaxJspeY0AErWA59qJ3eGzbiQq5RDWcbJe/Tz5r/6+NN
-DkvNQ7DaEZ6LpeWX0MUq6/QWfrM8yE95XhjyC1d3LYn32lXHUygbgTFWIgLDoOE6
-nBhu34SWtbLAnqYGewaJFxhlYVS9rb/uvYQg70r5X9Sx6alCQPiPyIv39IItezn2
-HF2GRfE91MPZUeDhdqdvvOlSZVM5KnYc1fhamGAwM48gdDDXe8Czu/JEGoANNvC3
-l/Z1p5RtGF4hrel9WpeX9zQq3pvtfVcVIiWuRUwCOSQytXlieRK37sMuYeggvmjV
-VvaCods3mS/panWg9T/D/deIXjhzNJLvyiJg8+3sY5H4yNe0XpbaAc/ySwt9Rcxy
-FzFQ+5pghLSZgR1uV3AhdcnzXBU2GkYhdGKt2tUsH0UeVQ2BXxTlBFsCOh2dWqcj
-y3suIG65bukDAAWidQ4q3S6ZIMpXBhhCj7nwB5jQ7wSlU3U9So0ndr7zxdUILiMm
-chHi3q5apVZnMGcwv2B33rt4nD7HgGEmRKkCelrSrBATY1ut+T4rCDzKDqDs3jpv
-hYIWrlNPTkJyQz3eWly6Db+FJEfdYGadYJusc7/nOxCh/QmUu8Sh3NhKT6TH0bS7
-1AAqd8H+2hJ9I32Dhd2qwAF7PkNe2LGi+P8tbAtepKGim5w65wnsPePMnrfxumsG
-PeDnMrqeCKy+fME7a/MS5kmEBpmD4BMhVC6/OhFVz8gBty1f8yIEZggHNQN2QK7m
-NIrG+PwqW2w8HoxOlAi2Ix4LTPifrdfsH02U7aM1pgo1rZzD4AOzqvzCaK43H2VB
-BHLeTBGoLEUxXA9C+iGbeQlKXkMC00QKkjK5+nvkvnvePFfsrTQIpuyGufD/MoPb
-6fpwsyHZDxhxMN1PJk1b1lPq2Ui4hXpVNOYd4Q6OQz7bwxTMRX9XQromUlKMMgAT
-edX8v2NdM7Ssy1IwHuGVbDEpZdjoeaWZ1iNRV17i/EaJAqwYDQLfsuHBlzZL1ov1
-xkKVJdL8Y3q80oRAzTQDVdzL/rI44LLAfv609YByCnw29feYJY2W6gV0O7ZSw413
-XUkc5CaEbR1LuG8NtnOOPJV4Tb/hNsIDtvVm7Hl5npBKBe4iVgQ2LNuC2eT69d/z
-uvzgjISlumPiO5ivuYe0QtLPuJSc+/Bl8bPL8gcNQEtqkzj7IftHPPZNs+bJC2uY
-bPjq5KoDNAMF6VHuKHwu48MBYpnXDIg3ZenmJwGRULRBhK6324hDS6NJ7ULTBU2M
-TZCHmg89ySLBfCAspVeo63o/R7bs9a7BP9x2h5uwCBogSvkEwhhPKnboVN45bp9c
------END RSA PRIVATE KEY-----

+ 0 - 9
vendor/lcobucci/jwt/test/functional/rsa/encrypted-public.key

@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwLpbUP8a9yflt5LKUUS3
-NPuRM7yEouPWg0VKeY5AURu4i8bqQ20K5jwfRJ+w05FvlywG4EuxpnpTFTVS2/do
-q3xufzTf/C3KIDOAHEifkdx4140btKxxm4mD9Eu2CQ32adZyScha50KUFlfnAAic
-Hb8wYxjFyWo3PAbGYmCQCn2z97Ab0Ar6NR1e+V9f8EL9Orr2f04puKJfQTZdWVDF
-UJR4w7QZ/CPY0LEsiFLW3QQCNraka1mtrLJwPqreBtDEkj8IoISNkrguu/97RQZz
-miJgBQkVjr6OfqG5WIFr0MzbRZc1/aK9g8ft88nhhQm0E3GqkCxBKTwgA03HtK07
-qQIDAQAB
------END PUBLIC KEY-----

+ 0 - 28
vendor/lcobucci/jwt/test/functional/rsa/private.key

@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTvwE87MtgREYL
-TL4aHhQo3ZzogmxxvMUsKnPzyxRs1YrXOSOpwN0npsXarBKKVIUMNLfFODp/vnQn
-2Zp06N8XG59WAOKwvC4MfxLDQkA+JXggzHlkbVoTN+dUkdYIFqSKuAPGwiWToRK2
-SxEhij3rE2FON8jQZvDxZkiP9a4vxJO3OTPQwKredXFiObsXD/c3RtLFhKctjCyH
-OIrP0bQEsee/m7JNtG4ry6BPusN6wb+vJo5ieBYPa3c19akNq6q/nYWhplhkkJSu
-aOrL5xXEFzI5TvcvnXR568GVcxK8YLfFkdxpsXGt5rAbeh0h/U5kILEAqv8P9PGT
-ZpicKbrnAgMBAAECggEAd3yTQEQHR91/ASVfKPHMQns77eCbPVtekFusbugsMHYY
-EPdHbqVMpvFvOMRc+f5Tzd15ziq6qBdbCJm8lThLm4iU0z1QrpaiDZ8vgUvDYM5Y
-CXoZDli+uZWUTp60/n94fmb0ipZIChScsI2PrzOJWTvobvD/uso8MJydWc8zafQm
-uqYzygOfjFZvU4lSfgzpefhpquy0JUy5TiKRmGUnwLb3TtcsVavjsn4QmNwLYgOF
-2OE+R12ex3pAKTiRE6FcnE1xFIo1GKhBa2Otgw3MDO6Gg+kn8Q4alKz6C6RRlgaH
-R7sYzEfJhsk/GGFTYOzXKQz2lSaStKt9wKCor04RcQKBgQDzPOu5jCTfayUo7xY2
-jHtiogHyKLLObt9l3qbwgXnaD6rnxYNvCrA0OMvT+iZXsFZKJkYzJr8ZOxOpPROk
-10WdOaefiwUyL5dypueSwlIDwVm+hI4Bs82MajHtzOozh+73wA+aw5rPs84Uix9w
-VbbwaVR6qP/BV09yJYS5kQ7fmwKBgQDe2xjywX2d2MC+qzRr+LfU+1+gq0jjhBCX
-WHqRN6IECB0xTnXUf9WL/VCoI1/55BhdbbEja+4btYgcXSPmlXBIRKQ4VtFfVmYB
-kPXeD8oZ7LyuNdCsbKNe+x1IHXDe6Wfs3L9ulCfXxeIE84wy3fd66mQahyXV9iD9
-CkuifMqUpQKBgQCiydHlY1LGJ/o9tA2Ewm5Na6mrvOs2V2Ox1NqbObwoYbX62eiF
-53xX5u8bVl5U75JAm+79it/4bd5RtKux9dUETbLOhwcaOFm+hM+VG/IxyzRZ2nMD
-1qcpY2U5BpxzknUvYF3RMTop6edxPk7zKpp9ubCtSu+oINvtxAhY/SkcIwKBgGP1
-upcImyO2GZ5shLL5eNubdSVILwV+M0LveOqyHYXZbd6z5r5OKKcGFKuWUnJwEU22
-6gGNY9wh7M9sJ7JBzX9c6pwqtPcidda2AtJ8GpbOTUOG9/afNBhiYpv6OKqD3w2r
-ZmJfKg/qvpqh83zNezgy8nvDqwDxyZI2j/5uIx/RAoGBAMWRmxtv6H2cKhibI/aI
-MTJM4QRjyPNxQqvAQsv+oHUbid06VK3JE+9iQyithjcfNOwnCaoO7I7qAj9QEfJS
-MZQc/W/4DHJebo2kd11yoXPVTXXOuEwLSKCejBXABBY0MPNuPUmiXeU0O3Tyi37J
-TUKzrgcd7NvlA41Y4xKcOqEA
------END PRIVATE KEY-----

+ 0 - 9
vendor/lcobucci/jwt/test/functional/rsa/public.key

@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA078BPOzLYERGC0y+Gh4U
-KN2c6IJscbzFLCpz88sUbNWK1zkjqcDdJ6bF2qwSilSFDDS3xTg6f750J9madOjf
-FxufVgDisLwuDH8Sw0JAPiV4IMx5ZG1aEzfnVJHWCBakirgDxsIlk6EStksRIYo9
-6xNhTjfI0Gbw8WZIj/WuL8STtzkz0MCq3nVxYjm7Fw/3N0bSxYSnLYwshziKz9G0
-BLHnv5uyTbRuK8ugT7rDesG/ryaOYngWD2t3NfWpDauqv52FoaZYZJCUrmjqy+cV
-xBcyOU73L510eevBlXMSvGC3xZHcabFxreawG3odIf1OZCCxAKr/D/Txk2aYnCm6
-5wIDAQAB
------END PUBLIC KEY-----

+ 0 - 633
vendor/lcobucci/jwt/test/unit/BuilderTest.php

@@ -1,633 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT;
-
-use Lcobucci\JWT\Claim\Factory as ClaimFactory;
-use Lcobucci\JWT\Parsing\Encoder;
-use Lcobucci\JWT\Signer\Key;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class BuilderTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @var Encoder|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $encoder;
-
-    /**
-     * @var ClaimFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $claimFactory;
-
-    /**
-     * @var Claim|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $defaultClaim;
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function setUp()
-    {
-        $this->encoder = $this->createMock(Encoder::class);
-        $this->claimFactory = $this->createMock(ClaimFactory::class);
-        $this->defaultClaim = $this->createMock(Claim::class);
-
-        $this->claimFactory->expects($this->any())
-                           ->method('create')
-                           ->willReturn($this->defaultClaim);
-    }
-
-    /**
-     * @return Builder
-     */
-    private function createBuilder()
-    {
-        return new Builder($this->encoder, $this->claimFactory);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Builder::__construct
-     */
-    public function constructMustInitializeTheAttributes()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals([], 'claims', $builder);
-        $this->assertAttributeSame($this->encoder, 'encoder', $builder);
-        $this->assertAttributeSame($this->claimFactory, 'claimFactory', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::permittedFor
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function permittedForMustChangeTheAudClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->permittedFor('test');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::permittedFor
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function permittedForCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->permittedFor('test', true);
-
-        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'aud' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::permittedFor
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function permittedForMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->permittedFor('test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::expiresAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function expiresAtMustChangeTheExpClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->expiresAt('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::expiresAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function expiresAtCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->expiresAt('2', true);
-
-        $this->assertAttributeEquals(['exp' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'exp' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::expiresAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function expiresAtMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->expiresAt('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::identifiedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function identifiedByMustChangeTheJtiClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->identifiedBy('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::identifiedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function identifiedByCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->identifiedBy('2', true);
-
-        $this->assertAttributeEquals(['jti' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'jti' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::identifiedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function identifiedByMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->identifiedBy('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedAtMustChangeTheIatClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->issuedAt('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedAtCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->issuedAt('2', true);
-
-        $this->assertAttributeEquals(['iat' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'iat' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedAt
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedAtMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->issuedAt('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedByMustChangeTheIssClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->issuedBy('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedByCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->issuedBy('2', true);
-
-        $this->assertAttributeEquals(['iss' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'iss' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::issuedBy
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function issuedByMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->issuedBy('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function canOnlyBeUsedAfterMustChangeTheNbfClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->canOnlyBeUsedAfter('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function canOnlyBeUsedAfterCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->canOnlyBeUsedAfter('2', true);
-
-        $this->assertAttributeEquals(['nbf' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'nbf' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::canOnlyBeUsedAfter
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function canOnlyBeUsedAfterMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->canOnlyBeUsedAfter('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::relatedTo
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function relatedToMustChangeTheSubClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->relatedTo('2');
-
-        $this->assertAttributeEquals(['alg' => 'none', 'typ' => 'JWT'], 'headers', $builder);
-        $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::relatedTo
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function relatedToCanReplicateItemOnHeader()
-    {
-        $builder = $this->createBuilder();
-        $builder->relatedTo('2', true);
-
-        $this->assertAttributeEquals(['sub' => $this->defaultClaim], 'claims', $builder);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'sub' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     *
-     * @covers Lcobucci\JWT\Builder::relatedTo
-     * @covers Lcobucci\JWT\Builder::setRegisteredClaim
-     */
-    public function relatedToMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->relatedTo('2'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     *
-     * @covers Lcobucci\JWT\Builder::withClaim
-     */
-    public function withClaimMustConfigureTheGivenClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->withClaim('userId', 2);
-
-        $this->assertAttributeEquals(['userId' => $this->defaultClaim], 'claims', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     *
-     * @covers Lcobucci\JWT\Builder::withClaim
-     */
-    public function withClaimMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->withClaim('userId', 2));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     *
-     * @covers Lcobucci\JWT\Builder::withHeader
-     */
-    public function withHeaderMustConfigureTheGivenClaim()
-    {
-        $builder = $this->createBuilder();
-        $builder->withHeader('userId', 2);
-
-        $this->assertAttributeEquals(
-            ['alg' => 'none', 'typ' => 'JWT', 'userId' => $this->defaultClaim],
-            'headers',
-            $builder
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     *
-     * @covers Lcobucci\JWT\Builder::withHeader
-     */
-    public function withHeaderMustKeepAFluentInterface()
-    {
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->withHeader('userId', 2));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::getToken
-     * @uses Lcobucci\JWT\Token
-     *
-     * @covers Lcobucci\JWT\Builder::sign
-     */
-    public function signMustConfigureSignerAndKey()
-    {
-        $signer = $this->createMock(Signer::class);
-
-        $builder = $this->createBuilder();
-        $builder->sign($signer, 'test');
-
-        $this->assertAttributeSame($signer, 'signer', $builder);
-        $this->assertAttributeEquals(new Key('test'), 'key', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::getToken
-     * @uses Lcobucci\JWT\Token
-     *
-     * @covers Lcobucci\JWT\Builder::sign
-     */
-    public function signMustKeepAFluentInterface()
-    {
-        $signer = $this->createMock(Signer::class);
-        $builder = $this->createBuilder();
-
-        $this->assertSame($builder, $builder->sign($signer, 'test'));
-
-        return $builder;
-    }
-
-    /**
-     * @test
-     *
-     * @depends signMustKeepAFluentInterface
-     *
-     * @covers Lcobucci\JWT\Builder::unsign
-     */
-    public function unsignMustRemoveTheSignerAndKey(Builder $builder)
-    {
-        $builder->unsign();
-
-        $this->assertAttributeSame(null, 'signer', $builder);
-        $this->assertAttributeSame(null, 'key', $builder);
-    }
-
-    /**
-     * @test
-     *
-     * @depends signMustKeepAFluentInterface
-     *
-     * @covers Lcobucci\JWT\Builder::unsign
-     */
-    public function unsignMustKeepAFluentInterface(Builder $builder)
-    {
-        $this->assertSame($builder, $builder->unsign());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Builder::__construct
-     * @uses Lcobucci\JWT\Builder::withClaim
-     * @uses Lcobucci\JWT\Token
-     *
-     * @covers Lcobucci\JWT\Builder::getToken
-     */
-    public function getTokenMustReturnANewTokenWithCurrentConfiguration()
-    {
-        $signer = $this->createMock(Signer::class);
-        $signature = $this->createMock(Signature::class);
-
-        $signer->method('sign')->willReturn($signature);
-
-        $this->encoder->expects($this->exactly(2))
-                      ->method('jsonEncode')
-                      ->withConsecutive([['typ'=> 'JWT', 'alg' => 'none']], [['test' => $this->defaultClaim]])
-                      ->willReturnOnConsecutiveCalls('1', '2');
-
-        $this->encoder->expects($this->exactly(3))
-                      ->method('base64UrlEncode')
-                      ->withConsecutive(['1'], ['2'], [$signature])
-                      ->willReturnOnConsecutiveCalls('1', '2', '3');
-
-        $builder = $this->createBuilder()->withClaim('test', 123);
-        $token = $builder->getToken($signer, new Key('testing'));
-
-        $this->assertAttributeEquals(['1', '2', '3'], 'payload', $token);
-        $this->assertAttributeEquals($token->getHeaders(), 'headers', $builder);
-        $this->assertAttributeEquals($token->getClaims(), 'claims', $builder);
-        $this->assertAttributeSame($signature, 'signature', $token);
-    }
-}

+ 0 - 84
vendor/lcobucci/jwt/test/unit/Claim/BasicTest.php

@@ -1,84 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Claim;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class BasicTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Claim\Basic::__construct
-     */
-    public function constructorShouldConfigureTheAttributes()
-    {
-        $claim = new Basic('test', 1);
-
-        $this->assertAttributeEquals('test', 'name', $claim);
-        $this->assertAttributeEquals(1, 'value', $claim);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Basic::getName
-     */
-    public function getNameShouldReturnTheClaimName()
-    {
-        $claim = new Basic('test', 1);
-
-        $this->assertEquals('test', $claim->getName());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Basic::getValue
-     */
-    public function getValueShouldReturnTheClaimValue()
-    {
-        $claim = new Basic('test', 1);
-
-        $this->assertEquals(1, $claim->getValue());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Basic::jsonSerialize
-     */
-    public function jsonSerializeShouldReturnTheClaimValue()
-    {
-        $claim = new Basic('test', 1);
-
-        $this->assertEquals(1, $claim->jsonSerialize());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Basic::__toString
-     */
-    public function toStringShouldReturnTheClaimValue()
-    {
-        $claim = new Basic('test', 1);
-
-        $this->assertEquals('1', (string) $claim);
-    }
-}

+ 0 - 83
vendor/lcobucci/jwt/test/unit/Claim/EqualsToTest.php

@@ -1,83 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Claim;
-
-use Lcobucci\JWT\ValidationData;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class EqualsToTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\EqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
-    {
-        $claim = new EqualsTo('iss', 'test');
-
-        $this->assertTrue($claim->validate(new ValidationData()));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\EqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
-    {
-        $claim = new EqualsTo('iss', 'test');
-
-        $data = new ValidationData();
-        $data->setIssuer('test');
-
-        $this->assertTrue($claim->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\EqualsTo::validate
-     */
-    public function validateShouldReturnFalseWhenValueIsNotEqualsToValidationData()
-    {
-        $claim = new EqualsTo('iss', 'test');
-
-        $data = new ValidationData();
-        $data->setIssuer('test1');
-
-        $this->assertFalse($claim->validate($data));
-    }
-}

+ 0 - 168
vendor/lcobucci/jwt/test/unit/Claim/FactoryTest.php

@@ -1,168 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Claim;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class FactoryTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::__construct
-     */
-    public function constructMustConfigureTheCallbacks()
-    {
-        $callback = function () {
-        };
-        $factory = new Factory(['test' => $callback]);
-
-        $expected = [
-            'iat' => [$factory, 'createLesserOrEqualsTo'],
-            'nbf' => [$factory, 'createLesserOrEqualsTo'],
-            'exp' => [$factory, 'createGreaterOrEqualsTo'],
-            'iss' => [$factory, 'createEqualsTo'],
-            'aud' => [$factory, 'createEqualsTo'],
-            'sub' => [$factory, 'createEqualsTo'],
-            'jti' => [$factory, 'createEqualsTo'],
-            'test' => $callback
-        ];
-
-        $this->assertAttributeEquals($expected, 'callbacks', $factory);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createLesserOrEqualsTo
-     */
-    public function createShouldReturnALesserOrEqualsToClaimForIssuedAt()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(LesserOrEqualsTo::class, $claim->create('iat', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createLesserOrEqualsTo
-     */
-    public function createShouldReturnALesserOrEqualsToClaimForNotBefore()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(LesserOrEqualsTo::class, $claim->create('nbf', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createGreaterOrEqualsTo
-     */
-    public function createShouldReturnAGreaterOrEqualsToClaimForExpiration()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(GreaterOrEqualsTo::class, $claim->create('exp', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
-     */
-    public function createShouldReturnAnEqualsToClaimForId()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(EqualsTo::class, $claim->create('jti', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
-     */
-    public function createShouldReturnAnEqualsToClaimForIssuer()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(EqualsTo::class, $claim->create('iss', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
-     */
-    public function createShouldReturnAnEqualsToClaimForAudience()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(EqualsTo::class, $claim->create('aud', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createEqualsTo
-     */
-    public function createShouldReturnAnEqualsToClaimForSubject()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(EqualsTo::class, $claim->create('sub', 1));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Factory::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Claim\Factory::create
-     * @covers Lcobucci\JWT\Claim\Factory::createBasic
-     */
-    public function createShouldReturnABasiclaimForOtherClaims()
-    {
-        $claim = new Factory();
-
-        $this->assertInstanceOf(Basic::class, $claim->create('test', 1));
-    }
-}

+ 0 - 107
vendor/lcobucci/jwt/test/unit/Claim/GreaterOrEqualsToTest.php

@@ -1,107 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Claim;
-
-use Lcobucci\JWT\ValidationData;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class GreaterOrEqualsToTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
-    {
-        $claim = new GreaterOrEqualsTo('iss', 10);
-
-        $this->assertTrue($claim->validate(new ValidationData()));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValueIsGreaterThanValidationData()
-    {
-        $claim = new GreaterOrEqualsTo('iss', 11);
-
-        $data = new ValidationData();
-        $data->setIssuer(10);
-
-        $this->assertTrue($claim->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
-    {
-        $claim = new GreaterOrEqualsTo('iss', 10);
-
-        $data = new ValidationData();
-        $data->setIssuer(10);
-
-        $this->assertTrue($claim->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\GreaterOrEqualsTo::validate
-     */
-    public function validateShouldReturnFalseWhenValueIsLesserThanValidationData()
-    {
-        $claim = new GreaterOrEqualsTo('iss', 10);
-
-        $data = new ValidationData();
-        $data->setIssuer(11);
-
-        $this->assertFalse($claim->validate($data));
-    }
-}

+ 0 - 107
vendor/lcobucci/jwt/test/unit/Claim/LesserOrEqualsToTest.php

@@ -1,107 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Claim;
-
-use Lcobucci\JWT\ValidationData;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class LesserOrEqualsToTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValidationDontHaveTheClaim()
-    {
-        $claim = new LesserOrEqualsTo('iss', 10);
-
-        $this->assertTrue($claim->validate(new ValidationData()));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValueIsLesserThanValidationData()
-    {
-        $claim = new LesserOrEqualsTo('iss', 10);
-
-        $data = new ValidationData();
-        $data->setIssuer(11);
-
-        $this->assertTrue($claim->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
-     */
-    public function validateShouldReturnTrueWhenValueIsEqualsToValidationData()
-    {
-        $claim = new LesserOrEqualsTo('iss', 10);
-
-        $data = new ValidationData();
-        $data->setIssuer(10);
-
-        $this->assertTrue($claim->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     * @uses Lcobucci\JWT\Claim\Basic::getName
-     * @uses Lcobucci\JWT\Claim\Basic::getValue
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setIssuer
-     * @uses Lcobucci\JWT\ValidationData::has
-     * @uses Lcobucci\JWT\ValidationData::get
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Claim\LesserOrEqualsTo::validate
-     */
-    public function validateShouldReturnFalseWhenValueIsGreaterThanValidationData()
-    {
-        $claim = new LesserOrEqualsTo('iss', 11);
-
-        $data = new ValidationData();
-        $data->setIssuer(10);
-
-        $this->assertFalse($claim->validate($data));
-    }
-}

+ 0 - 244
vendor/lcobucci/jwt/test/unit/ParserTest.php

@@ -1,244 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT;
-
-use Lcobucci\JWT\Claim\Factory as ClaimFactory;
-use Lcobucci\JWT\Parsing\Decoder;
-use RuntimeException;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class ParserTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @var Decoder|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $decoder;
-
-    /**
-     * @var ClaimFactory|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $claimFactory;
-
-    /**
-     * @var Claim|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $defaultClaim;
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function setUp()
-    {
-        $this->decoder = $this->createMock(Decoder::class);
-        $this->claimFactory = $this->createMock(ClaimFactory::class, [], [], '', false);
-        $this->defaultClaim = $this->createMock(Claim::class);
-
-        $this->claimFactory->expects($this->any())
-                           ->method('create')
-                           ->willReturn($this->defaultClaim);
-    }
-
-    /**
-     * @return Parser
-     */
-    private function createParser()
-    {
-        return new Parser($this->decoder, $this->claimFactory);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parser::__construct
-     */
-    public function constructMustConfigureTheAttributes()
-    {
-        $parser = $this->createParser();
-
-        $this->assertAttributeSame($this->decoder, 'decoder', $parser);
-        $this->assertAttributeSame($this->claimFactory, 'claimFactory', $parser);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     *
-     * @expectedException InvalidArgumentException
-     */
-    public function parseMustRaiseExceptionWhenJWSIsNotAString()
-    {
-        $parser = $this->createParser();
-        $parser->parse(['asdasd']);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     *
-     * @expectedException InvalidArgumentException
-     */
-    public function parseMustRaiseExceptionWhenJWSDontHaveThreeParts()
-    {
-        $parser = $this->createParser();
-        $parser->parse('');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     * @covers Lcobucci\JWT\Parser::parseHeader
-     *
-     * @expectedException RuntimeException
-     */
-    public function parseMustRaiseExceptionWhenHeaderCannotBeDecoded()
-    {
-        $this->decoder->expects($this->any())
-                      ->method('jsonDecode')
-                      ->willThrowException(new RuntimeException());
-
-        $parser = $this->createParser();
-        $parser->parse('asdfad.asdfasdf.');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     * @covers Lcobucci\JWT\Parser::parseHeader
-     *
-     * @expectedException InvalidArgumentException
-     */
-    public function parseMustRaiseExceptionWhenHeaderIsFromAnEncryptedToken()
-    {
-        $this->decoder->expects($this->any())
-                      ->method('jsonDecode')
-                      ->willReturn(['enc' => 'AAA']);
-
-        $parser = $this->createParser();
-        $parser->parse('a.a.');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     * @covers Lcobucci\JWT\Parser::parseHeader
-     * @covers Lcobucci\JWT\Parser::parseClaims
-     * @covers Lcobucci\JWT\Parser::parseSignature
-     *
-     */
-    public function parseMustReturnANonSignedTokenWhenSignatureIsNotInformed()
-    {
-        $this->decoder->expects($this->at(1))
-                      ->method('jsonDecode')
-                      ->willReturn(['typ' => 'JWT', 'alg' => 'none']);
-
-        $this->decoder->expects($this->at(3))
-                      ->method('jsonDecode')
-                      ->willReturn(['aud' => 'test']);
-
-        $parser = $this->createParser();
-        $token = $parser->parse('a.a.');
-
-        $this->assertAttributeEquals(['typ' => 'JWT', 'alg' => 'none'], 'headers', $token);
-        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
-        $this->assertAttributeEquals(null, 'signature', $token);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     * @covers Lcobucci\JWT\Parser::parseHeader
-     * @covers Lcobucci\JWT\Parser::parseClaims
-     * @covers Lcobucci\JWT\Parser::parseSignature
-     */
-    public function parseShouldReplicateClaimValueOnHeaderWhenNeeded()
-    {
-        $this->decoder->expects($this->at(1))
-                      ->method('jsonDecode')
-                      ->willReturn(['typ' => 'JWT', 'alg' => 'none', 'aud' => 'test']);
-
-        $this->decoder->expects($this->at(3))
-                      ->method('jsonDecode')
-                      ->willReturn(['aud' => 'test']);
-
-        $parser = $this->createParser();
-        $token = $parser->parse('a.a.');
-
-        $this->assertAttributeEquals(
-            ['typ' => 'JWT', 'alg' => 'none', 'aud' => $this->defaultClaim],
-            'headers',
-            $token
-        );
-
-        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
-        $this->assertAttributeEquals(null, 'signature', $token);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Parser::__construct
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Signature::__construct
-     *
-     * @covers Lcobucci\JWT\Parser::parse
-     * @covers Lcobucci\JWT\Parser::splitJwt
-     * @covers Lcobucci\JWT\Parser::parseHeader
-     * @covers Lcobucci\JWT\Parser::parseClaims
-     * @covers Lcobucci\JWT\Parser::parseSignature
-     */
-    public function parseMustReturnASignedTokenWhenSignatureIsInformed()
-    {
-        $this->decoder->expects($this->at(1))
-                      ->method('jsonDecode')
-                      ->willReturn(['typ' => 'JWT', 'alg' => 'HS256']);
-
-        $this->decoder->expects($this->at(3))
-                      ->method('jsonDecode')
-                      ->willReturn(['aud' => 'test']);
-
-        $this->decoder->expects($this->at(4))
-                      ->method('base64UrlDecode')
-                      ->willReturn('aaa');
-
-        $parser = $this->createParser();
-        $token = $parser->parse('a.a.a');
-
-        $this->assertAttributeEquals(['typ' => 'JWT', 'alg' => 'HS256'], 'headers', $token);
-        $this->assertAttributeEquals(['aud' => $this->defaultClaim], 'claims', $token);
-        $this->assertAttributeEquals(new Signature('aaa'), 'signature', $token);
-    }
-}

+ 0 - 56
vendor/lcobucci/jwt/test/unit/Parsing/DecoderTest.php

@@ -1,56 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Parsing;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class DecoderTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Decoder::jsonDecode
-     */
-    public function jsonDecodeMustReturnTheDecodedData()
-    {
-        $decoder = new Decoder();
-
-        $this->assertEquals(
-            (object) ['test' => 'test'],
-            $decoder->jsonDecode('{"test":"test"}')
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Decoder::jsonDecode
-     *
-     * @expectedException \RuntimeException
-     */
-    public function jsonDecodeMustRaiseExceptionWhenAnErrorHasOccured()
-    {
-        $decoder = new Decoder();
-        $decoder->jsonDecode('{"test":\'test\'}');
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Decoder::base64UrlDecode
-     */
-    public function base64UrlDecodeMustReturnTheRightData()
-    {
-        $data = base64_decode('0MB2wKB+L3yvIdzeggmJ+5WOSLaRLTUPXbpzqUe0yuo=');
-
-        $decoder = new Decoder();
-        $this->assertEquals($data, $decoder->base64UrlDecode('0MB2wKB-L3yvIdzeggmJ-5WOSLaRLTUPXbpzqUe0yuo'));
-    }
-}

+ 0 - 53
vendor/lcobucci/jwt/test/unit/Parsing/EncoderTest.php

@@ -1,53 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Parsing;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class EncoderTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode
-     */
-    public function jsonEncodeMustReturnAJSONString()
-    {
-        $encoder = new Encoder();
-
-        $this->assertEquals('{"test":"test"}', $encoder->jsonEncode(['test' => 'test']));
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Encoder::jsonEncode
-     *
-     * @expectedException \RuntimeException
-     */
-    public function jsonEncodeMustRaiseExceptionWhenAnErrorHasOccured()
-    {
-        $encoder = new Encoder();
-        $encoder->jsonEncode("\xB1\x31");
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Parsing\Encoder::base64UrlEncode
-     */
-    public function base64UrlEncodeMustReturnAnUrlSafeBase64()
-    {
-        $data = base64_decode('0MB2wKB+L3yvIdzeggmJ+5WOSLaRLTUPXbpzqUe0yuo=');
-
-        $encoder = new Encoder();
-        $this->assertEquals('0MB2wKB-L3yvIdzeggmJ-5WOSLaRLTUPXbpzqUe0yuo', $encoder->base64UrlEncode($data));
-    }
-}

+ 0 - 73
vendor/lcobucci/jwt/test/unit/SignatureTest.php

@@ -1,73 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class SignatureTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @var Signer|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $signer;
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function setUp()
-    {
-        $this->signer = $this->createMock(Signer::class);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signature::__construct
-     */
-    public function constructorMustConfigureAttributes()
-    {
-        $signature = new Signature('test');
-
-        $this->assertAttributeEquals('test', 'hash', $signature);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     *
-     * @covers Lcobucci\JWT\Signature::__toString
-     */
-    public function toStringMustReturnTheHash()
-    {
-        $signature = new Signature('test');
-
-        $this->assertEquals('test', (string) $signature);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     * @uses Lcobucci\JWT\Signature::__toString
-     *
-     * @covers Lcobucci\JWT\Signature::verify
-     */
-    public function verifyMustReturnWhatSignerSays()
-    {
-        $this->signer->expects($this->any())
-                     ->method('verify')
-                     ->willReturn(true);
-
-        $signature = new Signature('test');
-
-        $this->assertTrue($signature->verify($this->signer, 'one', 'key'));
-    }
-}

+ 0 - 128
vendor/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php

@@ -1,128 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer;
-
-use Lcobucci\JWT\Signature;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class BaseSignerTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @var BaseSigner|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $signer;
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function setUp()
-    {
-        $this->signer = $this->getMockForAbstractClass(BaseSigner::class);
-
-        $this->signer->method('getAlgorithmId')
-                     ->willReturn('TEST123');
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\BaseSigner::modifyHeader
-     */
-    public function modifyHeaderShouldChangeAlgorithm()
-    {
-        $headers = ['typ' => 'JWT'];
-
-        $this->signer->modifyHeader($headers);
-
-        $this->assertEquals($headers['typ'], 'JWT');
-        $this->assertEquals($headers['alg'], 'TEST123');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\BaseSigner::sign
-     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
-     */
-    public function signMustReturnANewSignature()
-    {
-        $key = new Key('123');
-
-        $this->signer->expects($this->once())
-                     ->method('createHash')
-                     ->with('test', $key)
-                     ->willReturn('test');
-
-        $this->assertEquals(new Signature('test'), $this->signer->sign('test', $key));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\BaseSigner::sign
-     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
-     */
-    public function signShouldConvertKeyWhenItsNotAnObject()
-    {
-        $this->signer->expects($this->once())
-                     ->method('createHash')
-                     ->with('test', new Key('123'))
-                     ->willReturn('test');
-
-        $this->assertEquals(new Signature('test'), $this->signer->sign('test', '123'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\BaseSigner::verify
-     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
-     */
-    public function verifyShouldDelegateTheCallToAbstractMethod()
-    {
-        $key = new Key('123');
-
-        $this->signer->expects($this->once())
-                     ->method('doVerify')
-                     ->with('test', 'test', $key)
-                     ->willReturn(true);
-
-        $this->assertTrue($this->signer->verify('test', 'test', $key));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signature::__construct
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\BaseSigner::verify
-     * @covers Lcobucci\JWT\Signer\BaseSigner::getKey
-     */
-    public function verifyShouldConvertKeyWhenItsNotAnObject()
-    {
-        $this->signer->expects($this->once())
-                     ->method('doVerify')
-                     ->with('test', 'test', new Key('123'))
-                     ->willReturn(true);
-
-        $this->assertTrue($this->signer->verify('test', 'test', '123'));
-    }
-}

+ 0 - 127
vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/MultibyteStringConverterTest.php

@@ -1,127 +0,0 @@
-<?php
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-use InvalidArgumentException;
-use PHPUnit\Framework\TestCase;
-use function bin2hex;
-use function hex2bin;
-use function strlen;
-
-/**
- * @coversDefaultClass \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
- */
-final class MultibyteStringConverterTest extends TestCase
-{
-    /**
-     * @test
-     * @dataProvider pointsConversionData
-     *
-     * @covers ::toAsn1
-     * @covers ::octetLength
-     * @covers ::preparePositiveInteger
-     */
-    public function toAsn1ShouldReturnThePointsInAnAsn1SequenceFormat(
-        $r,
-        $s,
-        $asn1
-    ) {
-        $converter = new MultibyteStringConverter();
-        $message   = hex2bin($r . $s);
-
-        self::assertSame($asn1, bin2hex($converter->toAsn1($message, strlen($r))));
-    }
-
-    /**
-     * @test
-     *
-     * @covers ::toAsn1
-     * @covers ::octetLength
-     */
-    public function toAsn1ShouldRaiseExceptionWhenPointsDoNotHaveCorrectLength()
-    {
-        $converter = new MultibyteStringConverter();
-
-        self::expectException(InvalidArgumentException::class);
-        $converter->toAsn1('a very wrong string', 64);
-    }
-
-    /**
-     * @test
-     * @dataProvider pointsConversionData
-     *
-     * @covers ::fromAsn1
-     * @covers ::readAsn1Content
-     * @covers ::readAsn1Integer
-     * @covers ::retrievePositiveInteger
-     */
-    public function fromAsn1ShouldReturnTheConcatenatedPoints($r, $s, $asn1)
-    {
-        $converter = new MultibyteStringConverter();
-        $message   = hex2bin($asn1);
-
-        self::assertSame($r . $s, bin2hex($converter->fromAsn1($message, strlen($r))));
-    }
-
-    /**
-     * @return string[][]
-     */
-    public function pointsConversionData()
-    {
-        return [
-            [
-                'efd48b2aacb6a8fd1140dd9cd45e81d69d2c877b56aaf991c34d0ea84eaf3716',
-                'f7cb1c942d657c41d436c7a1b6e29f65f3e900dbb9aff4064dc4ab2f843acda8',
-                '3046022100efd48b2aacb6a8fd1140dd9cd45e81d69d2c877b56aaf991c34d0ea84eaf3716022100f7cb1c942d657c41d436c7'
-                . 'a1b6e29f65f3e900dbb9aff4064dc4ab2f843acda8',
-            ],
-            [
-                '94edbb92a5ecb8aad4736e56c691916b3f88140666ce9fa73d64c4ea95ad133c81a648152e44acf96e36dd1e80fabe46',
-                '99ef4aeb15f178cea1fe40db2603138f130e740a19624526203b6351d0a3a94fa329c145786e679e7b82c71a38628ac8',
-                '306602310094edbb92a5ecb8aad4736e56c691916b3f88140666ce9fa73d64c4ea95ad133c81a648152e44acf96e36dd1e80fa'
-                . 'be4602310099ef4aeb15f178cea1fe40db2603138f130e740a19624526203b6351d0a3a94fa329c145786e679e7b82c71a38'
-                . '628ac8',
-            ],
-            [
-                '00c328fafcbd79dd77850370c46325d987cb525569fb63c5d3bc53950e6d4c5f174e25a1ee9017b5d450606add152b534931d7'
-                . 'd4e8455cc91f9b15bf05ec36e377fa',
-                '00617cce7cf5064806c467f678d3b4080d6f1cc50af26ca209417308281b68af282623eaa63e5b5c0723d8b8c37ff0777b1a20'
-                . 'f8ccb1dccc43997f1ee0e44da4a67a',
-                '308187024200c328fafcbd79dd77850370c46325d987cb525569fb63c5d3bc53950e6d4c5f174e25a1ee9017b5d450606add15'
-                . '2b534931d7d4e8455cc91f9b15bf05ec36e377fa0241617cce7cf5064806c467f678d3b4080d6f1cc50af26ca20941730828'
-                . '1b68af282623eaa63e5b5c0723d8b8c37ff0777b1a20f8ccb1dccc43997f1ee0e44da4a67a',
-            ],
-        ];
-    }
-
-    /**
-     * @test
-     * @dataProvider invalidAsn1Structures
-     *
-     * @covers ::fromAsn1
-     * @covers ::readAsn1Content
-     * @covers ::readAsn1Integer
-     * @covers ::retrievePositiveInteger
-     */
-    public function fromAsn1ShouldRaiseExceptionOnInvalidMessage($message)
-    {
-        $converter = new MultibyteStringConverter();
-        $message   = hex2bin($message);
-
-        $this->expectException(InvalidArgumentException::class);
-        $converter->fromAsn1($message, 64);
-    }
-
-    /**
-     * @return string[][]
-     */
-    public function invalidAsn1Structures()
-    {
-        return [
-            'Not a sequence'           => [''],
-            'Sequence without length'  => ['30'],
-            'Only one string element'  => ['3006030204f0'],
-            'Only one integer element' => ['3004020101'],
-            'Integer+string elements'  => ['300a020101030204f0'],
-        ];
-    }
-}

+ 0 - 60
vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php

@@ -1,60 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha256Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals('ES256', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals('sha256', $signer->getAlgorithm());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha256::getKeyLength
-     */
-    public function getKeyLengthMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals(64, $signer->getKeyLength());
-    }
-}

+ 0 - 60
vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha384Test.php

@@ -1,60 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha384Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals('ES384', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals('sha384', $signer->getAlgorithm());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha384::getKeyLength
-     */
-    public function getKeyLengthMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals(96, $signer->getKeyLength());
-    }
-}

+ 0 - 60
vendor/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha512Test.php

@@ -1,60 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Ecdsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha512Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals('ES512', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals('sha512', $signer->getAlgorithm());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Ecdsa
-     * @uses Lcobucci\JWT\Signer\OpenSSL
-     *
-     * @covers Lcobucci\JWT\Signer\Ecdsa\Sha512::getKeyLength
-     */
-    public function getKeyLengthMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals(132, $signer->getKeyLength());
-    }
-}

+ 0 - 117
vendor/lcobucci/jwt/test/unit/Signer/EcdsaTest.php

@@ -1,117 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer;
-
-use Lcobucci\JWT\Keys;
-use Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter;
-use const OPENSSL_ALGO_SHA256;
-use function openssl_pkey_get_private;
-use function openssl_pkey_get_public;
-use function openssl_sign;
-use function openssl_verify;
-
-class EcdsaTest extends \PHPUnit\Framework\TestCase
-{
-    use Keys;
-
-    /**
-     * @var MultibyteStringConverter
-     */
-    private $pointsManipulator;
-
-    /**
-     * @before
-     */
-    public function createDependencies()
-    {
-        $this->pointsManipulator = new MultibyteStringConverter();
-    }
-
-    private function getSigner()
-    {
-        $signer = $this->getMockForAbstractClass(Ecdsa::class, [$this->pointsManipulator]);
-
-        $signer->method('getAlgorithm')
-            ->willReturn(OPENSSL_ALGO_SHA256);
-
-        $signer->method('getAlgorithmId')
-            ->willReturn('ES256');
-
-        $signer->method('getKeyLength')
-            ->willReturn(64);
-
-        return $signer;
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Ecdsa::createHash
-     * @covers \Lcobucci\JWT\Signer\Ecdsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
-     * @uses \Lcobucci\JWT\Signer\Key
-     * @uses \Lcobucci\JWT\Signature
-     */
-    public function createHashShouldReturnTheAHashBasedOnTheOpenSslSignature()
-    {
-        $payload = 'testing';
-
-        $signer    = $this->getSigner();
-        $signature = $signer->sign($payload, self::$ecdsaKeys['private']);
-
-        $publicKey = openssl_pkey_get_public(self::$ecdsaKeys['public1']->getContent());
-
-        self::assertInternalType('resource', $publicKey);
-        self::assertSame(
-            1,
-            openssl_verify(
-                $payload,
-                $this->pointsManipulator->toAsn1($signature, $signer->getKeyLength()),
-                $publicKey,
-                OPENSSL_ALGO_SHA256
-            )
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Ecdsa::doVerify
-     * @covers \Lcobucci\JWT\Signer\Ecdsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\Ecdsa\MultibyteStringConverter
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Ecdsa::__construct
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function doVerifyShouldDelegateToEcdsaSignerUsingPublicKey()
-    {
-        $payload    = 'testing';
-        $privateKey = openssl_pkey_get_private(self::$ecdsaKeys['private']->getContent());
-
-        self::assertInternalType('resource', $privateKey);
-
-        $signature = '';
-        openssl_sign($payload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
-
-        $signer = $this->getSigner();
-
-        self::assertTrue(
-            $signer->verify(
-                $this->pointsManipulator->fromAsn1($signature, $signer->getKeyLength()),
-                $payload,
-                self::$ecdsaKeys['public1']
-            )
-        );
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha256Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Hmac;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class Sha256Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha256::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals('HS256', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha256::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals('sha256', $signer->getAlgorithm());
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha384Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Hmac;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class Sha384Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha384::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals('HS384', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha384::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals('sha384', $signer->getAlgorithm());
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Hmac;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class Sha512Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha512::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals('HS512', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac\Sha512::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals('sha512', $signer->getAlgorithm());
-    }
-}

+ 0 - 134
vendor/lcobucci/jwt/test/unit/Signer/HmacTest.php

@@ -1,134 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class HmacTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @var Hmac|\PHPUnit_Framework_MockObject_MockObject
-     */
-    protected $signer;
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function setUp()
-    {
-        $this->signer = $this->getMockForAbstractClass(Hmac::class);
-
-        $this->signer->expects($this->any())
-                     ->method('getAlgorithmId')
-                     ->willReturn('TEST123');
-
-        $this->signer->expects($this->any())
-                     ->method('getAlgorithm')
-                     ->willReturn('sha256');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::createHash
-     */
-    public function createHashMustReturnAHashAccordingWithTheAlgorithm()
-    {
-        $hash = hash_hmac('sha256', 'test', '123', true);
-
-        $this->assertEquals($hash, $this->signer->createHash('test', new Key('123')));
-
-        return $hash;
-    }
-
-    /**
-     * @test
-     *
-     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
-     *
-     * @uses Lcobucci\JWT\Signer\Hmac::createHash
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
-     */
-    public function doVerifyShouldReturnTrueWhenExpectedHashWasCreatedWithSameInformation($expected)
-    {
-        $this->assertTrue($this->signer->doVerify($expected, 'test', new Key('123')));
-    }
-
-    /**
-     * @test
-     *
-     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
-     *
-     * @uses Lcobucci\JWT\Signer\Hmac::createHash
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
-     */
-    public function doVerifyShouldReturnFalseWhenExpectedHashWasNotCreatedWithSameInformation($expected)
-    {
-        $this->assertFalse($this->signer->doVerify($expected, 'test', new Key('1234')));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::doVerify
-     */
-    public function doVerifyShouldReturnFalseWhenExpectedHashIsNotString()
-    {
-        $this->assertFalse($this->signer->doVerify(false, 'test', new Key('1234')));
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
-     */
-    public function hashEqualsShouldReturnFalseWhenExpectedHashHasDifferentLengthThanGenerated()
-    {
-        $this->assertFalse($this->signer->hashEquals('123', '1234'));
-    }
-
-    /**
-     * @test
-     *
-     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
-     *
-     * @uses Lcobucci\JWT\Signer\Hmac::createHash
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
-     */
-    public function hashEqualsShouldReturnFalseWhenExpectedHashIsDifferentThanGenerated($expected)
-    {
-        $this->assertFalse($this->signer->hashEquals($expected, $this->signer->createHash('test', new Key('1234'))));
-    }
-
-    /**
-     * @test
-     *
-     * @depends createHashMustReturnAHashAccordingWithTheAlgorithm
-     *
-     * @uses Lcobucci\JWT\Signer\Hmac::createHash
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Hmac::hashEquals
-     */
-    public function hashEqualsShouldReturnTrueWhenExpectedHashIsEqualsThanGenerated($expected)
-    {
-        $this->assertTrue($this->signer->hashEquals($expected, $this->signer->createHash('test', new Key('123'))));
-    }
-}

+ 0 - 119
vendor/lcobucci/jwt/test/unit/Signer/KeyTest.php

@@ -1,119 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer;
-
-use org\bovigo\vfs\vfsStream;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 3.0.4
- */
-class KeyTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @before
-     */
-    public function configureRootDir()
-    {
-        vfsStream::setup(
-            'root',
-            null,
-            [
-                'test.pem' => 'testing',
-                'emptyFolder' => []
-            ]
-        );
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Key::__construct
-     * @covers Lcobucci\JWT\Signer\Key::setContent
-     */
-    public function constructShouldConfigureContentAndPassphrase()
-    {
-        $key = new Key('testing', 'test');
-
-        $this->assertAttributeEquals('testing', 'content', $key);
-        $this->assertAttributeEquals('test', 'passphrase', $key);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Key::__construct
-     * @covers Lcobucci\JWT\Signer\Key::setContent
-     * @covers Lcobucci\JWT\Signer\Key::readFile
-     */
-    public function constructShouldBeAbleToConfigureContentFromFile()
-    {
-        $key = new Key('file://' . vfsStream::url('root/test.pem'));
-
-        $this->assertAttributeEquals('testing', 'content', $key);
-        $this->assertAttributeEquals(null, 'passphrase', $key);
-    }
-
-    /**
-     * @test
-     *
-     * @expectedException \InvalidArgumentException
-     *
-     * @covers Lcobucci\JWT\Signer\Key::__construct
-     * @covers Lcobucci\JWT\Signer\Key::setContent
-     * @covers Lcobucci\JWT\Signer\Key::readFile
-     */
-    public function constructShouldRaiseExceptionWhenFileDoesNotExists()
-    {
-        new Key('file://' . vfsStream::url('root/test2.pem'));
-    }
-
-    /**
-     * @test
-     *
-     * @expectedException \InvalidArgumentException
-     *
-     * @covers Lcobucci\JWT\Signer\Key::__construct
-     * @covers Lcobucci\JWT\Signer\Key::setContent
-     * @covers Lcobucci\JWT\Signer\Key::readFile
-     */
-    public function constructShouldRaiseExceptionWhenFileGetContentsFailed()
-    {
-        new Key('file://' . vfsStream::url('root/emptyFolder'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key::__construct
-     * @uses Lcobucci\JWT\Signer\Key::setContent
-     *
-     * @covers Lcobucci\JWT\Signer\Key::getContent
-     */
-    public function getContentShouldReturnConfiguredData()
-    {
-        $key = new Key('testing', 'test');
-
-        $this->assertEquals('testing', $key->getContent());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key::__construct
-     * @uses Lcobucci\JWT\Signer\Key::setContent
-     *
-     * @covers Lcobucci\JWT\Signer\Key::getPassphrase
-     */
-    public function getPassphraseShouldReturnConfiguredData()
-    {
-        $key = new Key('testing', 'test');
-
-        $this->assertEquals('test', $key->getPassphrase());
-    }
-}

+ 0 - 49
vendor/lcobucci/jwt/test/unit/Signer/KeychainTest.php

@@ -1,49 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class KeychainTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Keychain::getPrivateKey
-     */
-    public function getPrivateKeyShouldReturnAKey()
-    {
-        $keychain = new Keychain();
-        $key = $keychain->getPrivateKey('testing', 'test');
-
-        $this->assertInstanceOf(Key::class, $key);
-        $this->assertAttributeEquals('testing', 'content', $key);
-        $this->assertAttributeEquals('test', 'passphrase', $key);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Signer\Key
-     *
-     * @covers Lcobucci\JWT\Signer\Keychain::getPublicKey
-     */
-    public function getPublicKeyShouldReturnAValidResource()
-    {
-        $keychain = new Keychain();
-        $key = $keychain->getPublicKey('testing');
-
-        $this->assertInstanceOf(Key::class, $key);
-        $this->assertAttributeEquals('testing', 'content', $key);
-        $this->assertAttributeEquals(null, 'passphrase', $key);
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha256Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Rsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha256Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals('RS256', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha256::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha256();
-
-        $this->assertEquals(OPENSSL_ALGO_SHA256, $signer->getAlgorithm());
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Rsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha384Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha384::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals('RS384', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha384::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha384();
-
-        $this->assertEquals(OPENSSL_ALGO_SHA384, $signer->getAlgorithm());
-    }
-}

+ 0 - 39
vendor/lcobucci/jwt/test/unit/Signer/Rsa/Sha512Test.php

@@ -1,39 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT\Signer\Rsa;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.1.0
- */
-class Sha512Test extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha512::getAlgorithmId
-     */
-    public function getAlgorithmIdMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals('RS512', $signer->getAlgorithmId());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Signer\Rsa\Sha512::getAlgorithm
-     */
-    public function getAlgorithmMustBeCorrect()
-    {
-        $signer = new Sha512();
-
-        $this->assertEquals(OPENSSL_ALGO_SHA512, $signer->getAlgorithm());
-    }
-}

+ 0 - 188
vendor/lcobucci/jwt/test/unit/Signer/RsaTest.php

@@ -1,188 +0,0 @@
-<?php
-namespace Lcobucci\JWT\Signer;
-
-use InvalidArgumentException;
-use Lcobucci\JWT\Keys;
-use PHPUnit\Framework\TestCase;
-use const OPENSSL_ALGO_SHA256;
-use function openssl_pkey_get_private;
-use function openssl_pkey_get_public;
-use function openssl_sign;
-use function openssl_verify;
-
-final class RsaTest extends TestCase
-{
-    use Keys;
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     * @uses \Lcobucci\JWT\Signature
-     */
-    public function createHashShouldReturnAValidOpensslSignature()
-    {
-        $payload = 'testing';
-
-        $signer    = $this->getSigner();
-        $signature = $signer->sign($payload, self::$rsaKeys['private']);
-
-        $publicKey = openssl_pkey_get_public(self::$rsaKeys['public']->getContent());
-        self::assertInternalType('resource', $publicKey);
-        self::assertSame(1, openssl_verify($payload, $signature, $publicKey, OPENSSL_ALGO_SHA256));
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function createHashShouldRaiseAnExceptionWhenKeyIsInvalid()
-    {
-        $key = <<<KEY
------BEGIN RSA PRIVATE KEY-----
-MGECAQACEQC4MRKSVsq5XnRBrJoX6+rnAgMBAAECECO8SZkgw6Yg66A6SUly/3kC
-CQDtPXZtCQWJuwIJAMbBu17GDOrFAggopfhNlFcjkwIIVjb7G+U0/TECCEERyvxP
-TWdN
------END RSA PRIVATE KEY-----
-KEY;
-
-        $signer = $this->getSigner();
-
-        $this->expectException(InvalidArgumentException::class);
-        $this->expectExceptionMessage('There was an error while creating the signature');
-
-        $signer->sign('testing', new Key($key));
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function createHashShouldRaiseAnExceptionWhenKeyIsNotParseable()
-    {
-        $signer = $this->getSigner();
-
-        $this->expectException(InvalidArgumentException::class);
-        $this->expectExceptionMessage('It was not possible to parse your key');
-
-        $signer->sign('testing', new Key('blablabla'));
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::createHash
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function createHashShouldRaiseAnExceptionWhenKeyTypeIsNotRsa()
-    {
-        $signer = $this->getSigner();
-
-        $this->expectException(InvalidArgumentException::class);
-        $this->expectExceptionMessage('This key is not compatible with this signer');
-
-        $signer->sign('testing', self::$ecdsaKeys['private']);
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\Rsa::getKeyType
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function doVerifyShouldReturnTrueWhenSignatureIsValid()
-    {
-        $payload    = 'testing';
-        $privateKey = openssl_pkey_get_private(self::$rsaKeys['private']->getContent());
-        self::assertInternalType('resource', $privateKey);
-
-        $signature = '';
-        openssl_sign($payload, $signature, $privateKey, OPENSSL_ALGO_SHA256);
-
-        $signer = $this->getSigner();
-
-        self::assertTrue($signer->verify($signature, $payload, self::$rsaKeys['public']));
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function doVerifyShouldRaiseAnExceptionWhenKeyIsNotParseable()
-    {
-        $signer = $this->getSigner();
-
-        $this->expectException(InvalidArgumentException::class);
-        $this->expectExceptionMessage('It was not possible to parse your key');
-
-        $signer->verify('testing', 'testing', new Key('blablabla'));
-    }
-
-    /**
-     * @test
-     *
-     * @covers \Lcobucci\JWT\Signer\Rsa::doVerify
-     * @covers \Lcobucci\JWT\Signer\Rsa::validateKey
-     * @covers \Lcobucci\JWT\Signer\OpenSSL
-     * @covers \Lcobucci\JWT\Signer\BaseSigner
-     *
-     * @uses \Lcobucci\JWT\Signer\Key
-     */
-    public function doVerifyShouldRaiseAnExceptionWhenKeyTypeIsNotRsa()
-    {
-        $signer = $this->getSigner();
-
-        $this->expectException(InvalidArgumentException::class);
-        $this->expectExceptionMessage('It was not possible to parse your key');
-
-        $signer->verify('testing', 'testing', self::$ecdsaKeys['private']);
-    }
-
-    private function getSigner()
-    {
-        $signer = $this->getMockForAbstractClass(Rsa::class);
-
-        $signer->method('getAlgorithm')
-               ->willReturn(OPENSSL_ALGO_SHA256);
-
-        $signer->method('getAlgorithmId')
-               ->willReturn('RS256');
-
-        return $signer;
-    }
-}

+ 0 - 573
vendor/lcobucci/jwt/test/unit/TokenTest.php

@@ -1,573 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT;
-
-use DateInterval;
-use DateTime;
-use Lcobucci\JWT\Claim\Basic;
-use Lcobucci\JWT\Claim\EqualsTo;
-use Lcobucci\JWT\Claim\GreaterOrEqualsTo;
-use Lcobucci\JWT\Claim\LesserOrEqualsTo;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 0.1.0
- */
-class TokenTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Token::__construct
-     */
-    public function constructMustInitializeAnEmptyPlainTextTokenWhenNoArgumentsArePassed()
-    {
-        $token = new Token();
-
-        $this->assertAttributeEquals(['alg' => 'none'], 'headers', $token);
-        $this->assertAttributeEquals([], 'claims', $token);
-        $this->assertAttributeEquals(null, 'signature', $token);
-        $this->assertAttributeEquals(['', ''], 'payload', $token);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::hasHeader
-     */
-    public function hasHeaderMustReturnTrueWhenItIsConfigured()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $this->assertTrue($token->hasHeader('test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::hasHeader
-     */
-    public function hasHeaderMustReturnFalseWhenItIsNotConfigured()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $this->assertFalse($token->hasHeader('testing'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasHeader
-     *
-     * @covers Lcobucci\JWT\Token::getHeader
-     *
-     * @expectedException \OutOfBoundsException
-     */
-    public function getHeaderMustRaiseExceptionWhenHeaderIsNotConfigured()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $token->getHeader('testing');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasHeader
-     *
-     * @covers Lcobucci\JWT\Token::getHeader
-     */
-    public function getHeaderMustReturnTheDefaultValueWhenIsNotConfigured()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $this->assertEquals('blah', $token->getHeader('testing', 'blah'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasHeader
-     *
-     * @covers Lcobucci\JWT\Token::getHeader
-     * @covers Lcobucci\JWT\Token::getHeaderValue
-     */
-    public function getHeaderMustReturnTheRequestedHeader()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $this->assertEquals('testing', $token->getHeader('test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasHeader
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::getHeader
-     * @covers Lcobucci\JWT\Token::getHeaderValue
-     */
-    public function getHeaderMustReturnValueWhenItIsAReplicatedClaim()
-    {
-        $token = new Token(['jti' => new EqualsTo('jti', 1)]);
-
-        $this->assertEquals(1, $token->getHeader('jti'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::getHeaders
-     */
-    public function getHeadersMustReturnTheConfiguredHeader()
-    {
-        $token = new Token(['test' => 'testing']);
-
-        $this->assertEquals(['test' => 'testing'], $token->getHeaders());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::getClaims
-     */
-    public function getClaimsMustReturnTheConfiguredClaims()
-    {
-        $token = new Token([], ['test' => 'testing']);
-
-        $this->assertEquals(['test' => 'testing'], $token->getClaims());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::hasClaim
-     */
-    public function hasClaimMustReturnTrueWhenItIsConfigured()
-    {
-        $token = new Token([], ['test' => new Basic('test', 'testing')]);
-
-        $this->assertTrue($token->hasClaim('test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::hasClaim
-     */
-    public function hasClaimMustReturnFalseWhenItIsNotConfigured()
-    {
-        $token = new Token([], ['test' => new Basic('test', 'testing')]);
-
-        $this->assertFalse($token->hasClaim('testing'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasClaim
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::getClaim
-     */
-    public function getClaimMustReturnTheDefaultValueWhenIsNotConfigured()
-    {
-        $token = new Token([], ['test' => new Basic('test', 'testing')]);
-
-        $this->assertEquals('blah', $token->getClaim('testing', 'blah'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasClaim
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::getClaim
-     *
-     * @expectedException \OutOfBoundsException
-     */
-    public function getClaimShouldRaiseExceptionWhenClaimIsNotConfigured()
-    {
-        $token = new Token();
-        $token->getClaim('testing');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::hasClaim
-     * @uses Lcobucci\JWT\Claim\Basic
-     *
-     * @covers Lcobucci\JWT\Token::getClaim
-     */
-    public function getClaimShouldReturnTheClaimValueWhenItExists()
-    {
-        $token = new Token([], ['testing' => new Basic('testing', 'test')]);
-
-        $this->assertEquals('test', $token->getClaim('testing'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::verify
-     *
-     * @expectedException BadMethodCallException
-     */
-    public function verifyMustRaiseExceptionWhenTokenIsUnsigned()
-    {
-        $signer = $this->createMock(Signer::class);
-
-        $token = new Token();
-        $token->verify($signer, 'test');
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::verify
-     * @covers Lcobucci\JWT\Token::getPayload
-     */
-    public function verifyShouldReturnFalseWhenTokenAlgorithmIsDifferent()
-    {
-        $signer = $this->createMock(Signer::class);
-        $signature = $this->createMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('getAlgorithmId')
-               ->willReturn('HS256');
-
-        $signature->expects($this->never())
-                  ->method('verify');
-
-        $token = new Token(['alg' => 'RS256'], [], $signature);
-
-        $this->assertFalse($token->verify($signer, 'test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::verify
-     * @covers Lcobucci\JWT\Token::getPayload
-     */
-    public function verifyMustDelegateTheValidationToSignature()
-    {
-        $signer = $this->createMock(Signer::class);
-        $signature = $this->createMock(Signature::class, [], [], '', false);
-
-        $signer->expects($this->any())
-               ->method('getAlgorithmId')
-               ->willReturn('HS256');
-
-        $signature->expects($this->once())
-                  ->method('verify')
-                  ->with($signer, $this->isType('string'), 'test')
-                  ->willReturn(true);
-
-        $token = new Token(['alg' => 'HS256'], [], $signature);
-
-        $this->assertTrue($token->verify($signer, 'test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnTrueWhenClaimsAreEmpty()
-    {
-        $token = new Token();
-
-        $this->assertTrue($token->validate(new ValidationData()));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     * @uses Lcobucci\JWT\Claim\Basic::__construct
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnTrueWhenThereAreNoValidatableClaims()
-    {
-        $token = new Token([], ['testing' => new Basic('testing', 'test')]);
-
-        $this->assertTrue($token->validate(new ValidationData()));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\EqualsTo
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnFalseWhenThereIsAtLeastOneFailedValidatableClaim()
-    {
-        $token = new Token(
-            [],
-            [
-                'iss' => new EqualsTo('iss', 'test'),
-                'testing' => new Basic('testing', 'test')
-            ]
-        );
-
-        $data = new ValidationData();
-        $data->setIssuer('test1');
-
-        $this->assertFalse($token->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\EqualsTo
-     * @uses Lcobucci\JWT\Claim\LesserOrEqualsTo
-     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnFalseWhenATimeBasedClaimFails()
-    {
-        $now = time();
-
-        $token = new Token(
-            [],
-            [
-                'iss' => new EqualsTo('iss', 'test'),
-                'iat' => new LesserOrEqualsTo('iat', $now),
-                'nbf' => new LesserOrEqualsTo('nbf', $now + 20),
-                'exp' => new GreaterOrEqualsTo('exp', $now + 500),
-                'testing' => new Basic('testing', 'test')
-            ]
-        );
-
-        $data = new ValidationData($now + 10);
-        $data->setIssuer('test');
-
-        $this->assertFalse($token->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\EqualsTo
-     * @uses Lcobucci\JWT\Claim\LesserOrEqualsTo
-     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnTrueWhenThereAreNoFailedValidatableClaims()
-    {
-        $now = time();
-
-        $token = new Token(
-            [],
-            [
-                'iss' => new EqualsTo('iss', 'test'),
-                'iat' => new LesserOrEqualsTo('iat', $now),
-                'exp' => new GreaterOrEqualsTo('exp', $now + 500),
-                'testing' => new Basic('testing', 'test')
-            ]
-        );
-
-        $data = new ValidationData($now + 10);
-        $data->setIssuer('test');
-
-        $this->assertTrue($token->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\ValidationData
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\EqualsTo
-     * @uses Lcobucci\JWT\Claim\LesserOrEqualsTo
-     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
-     *
-     * @covers Lcobucci\JWT\Token::validate
-     * @covers Lcobucci\JWT\Token::getValidatableClaims
-     */
-    public function validateShouldReturnTrueWhenLeewayMakesAllTimeBasedClaimsTrueAndOtherClaimsAreTrue()
-    {
-        $now = time();
-
-        $token = new Token(
-            [],
-            [
-                'iss' => new EqualsTo('iss', 'test'),
-                'iat' => new LesserOrEqualsTo('iat', $now),
-                'nbf' => new LesserOrEqualsTo('nbf', $now + 20),
-                'exp' => new GreaterOrEqualsTo('exp', $now + 500),
-                'testing' => new Basic('testing', 'test')
-            ]
-        );
-
-        $data = new ValidationData($now + 10, 20);
-        $data->setIssuer('test');
-
-        $this->assertTrue($token->validate($data));
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Token::isExpired
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::getClaim
-     * @uses Lcobucci\JWT\Token::hasClaim
-     */
-    public function isExpiredShouldReturnFalseWhenTokenDoesNotExpires()
-    {
-        $token = new Token(['alg' => 'none']);
-
-        $this->assertFalse($token->isExpired());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Token::isExpired
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::getClaim
-     * @uses Lcobucci\JWT\Token::hasClaim
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
-     */
-    public function isExpiredShouldReturnFalseWhenTokenIsNotExpired()
-    {
-        $token = new Token(
-            ['alg' => 'none'],
-            ['exp' => new GreaterOrEqualsTo('exp', time() + 500)]
-        );
-
-        $this->assertFalse($token->isExpired());
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\Token::isExpired
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::getClaim
-     * @uses Lcobucci\JWT\Token::hasClaim
-     * @uses Lcobucci\JWT\Claim\Basic
-     * @uses Lcobucci\JWT\Claim\GreaterOrEqualsTo
-     */
-    public function isExpiredShouldReturnTrueAfterTokenExpires()
-    {
-        $token = new Token(
-            ['alg' => 'none'],
-            ['exp' => new GreaterOrEqualsTo('exp', time())]
-        );
-
-        $this->assertTrue($token->isExpired(new DateTime('+10 days')));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     *
-     * @covers Lcobucci\JWT\Token::getPayload
-     */
-    public function getPayloadShouldReturnAStringWithTheTwoEncodePartsThatGeneratedTheToken()
-    {
-        $token = new Token(['alg' => 'none'], [], null, ['test1', 'test2', 'test3']);
-
-        $this->assertEquals('test1.test2', $token->getPayload());
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::getPayload
-     *
-     * @covers Lcobucci\JWT\Token::__toString
-     */
-    public function toStringMustReturnEncodedDataWithEmptySignature()
-    {
-        $token = new Token(['alg' => 'none'], [], null, ['test', 'test']);
-
-        $this->assertEquals('test.test.', (string) $token);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\Token::__construct
-     * @uses Lcobucci\JWT\Token::getPayload
-     *
-     * @covers Lcobucci\JWT\Token::__toString
-     */
-    public function toStringMustReturnEncodedData()
-    {
-        $signature = $this->createMock(Signature::class, [], [], '', false);
-
-        $token = new Token(['alg' => 'none'], [], $signature, ['test', 'test', 'test']);
-
-        $this->assertEquals('test.test.test', (string) $token);
-    }
-}

+ 0 - 270
vendor/lcobucci/jwt/test/unit/ValidationDataTest.php

@@ -1,270 +0,0 @@
-<?php
-/**
- * This file is part of Lcobucci\JWT, a simple library to handle JWT and JWS
- *
- * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
- */
-
-namespace Lcobucci\JWT;
-
-/**
- * @author Luís Otávio Cobucci Oblonczyk <lcobucci@gmail.com>
- * @since 2.0.0
- */
-class ValidationDataTest extends \PHPUnit\Framework\TestCase
-{
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\ValidationData::__construct
-     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
-     */
-    public function constructorShouldConfigureTheItems()
-    {
-        $expected = $this->createExpectedData();
-        $data = new ValidationData(1);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @covers Lcobucci\JWT\ValidationData::__construct
-     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
-     */
-    public function constructorWithLeewayShouldConfigureTheItems()
-    {
-        $expected = $this->createExpectedData(null, null, null, null, 111, 111, 89);
-        $data = new ValidationData(100, 11);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @dataProvider claimValues
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setId
-     */
-    public function setIdShouldChangeTheId($id)
-    {
-        $expected = $this->createExpectedData($id);
-        $data = new ValidationData(1);
-        $data->setId($id);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @dataProvider claimValues
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setIssuer
-     */
-    public function setIssuerShouldChangeTheIssuer($iss)
-    {
-        $expected = $this->createExpectedData(null, null, $iss);
-        $data = new ValidationData(1);
-        $data->setIssuer($iss);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @dataProvider claimValues
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setAudience
-     */
-    public function setAudienceShouldChangeTheAudience($aud)
-    {
-        $expected = $this->createExpectedData(null, null, null, $aud);
-        $data = new ValidationData(1);
-        $data->setAudience($aud);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @dataProvider claimValues
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setSubject
-     */
-    public function setSubjectShouldChangeTheSubject($sub)
-    {
-        $expected = $this->createExpectedData(null, $sub);
-        $data = new ValidationData(1);
-        $data->setSubject($sub);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
-     */
-    public function setCurrentTimeShouldChangeTheTimeBasedValues()
-    {
-        $expected = $this->createExpectedData(null, null, null, null, 2);
-        $data = new ValidationData(1);
-        $data->setCurrentTime(2);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @uses   Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::setCurrentTime
-     */
-    public function setCurrentTimeShouldChangeTheTimeBasedValuesUsingLeeway()
-    {
-        $expected = $this->createExpectedData(null, null, null, null, 30, 30, 10);
-        $data = new ValidationData(15, 10);
-        $data->setCurrentTime(20);
-
-        $this->assertAttributeSame($expected, 'items', $data);
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::has
-     */
-    public function hasShouldReturnTrueWhenItemIsNotEmpty()
-    {
-        $data = new ValidationData(1);
-
-        $this->assertTrue($data->has('iat'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::has
-     */
-    public function hasShouldReturnFalseWhenItemIsEmpty()
-    {
-        $data = new ValidationData(1);
-
-        $this->assertFalse($data->has('jti'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::has
-     */
-    public function hasShouldReturnFalseWhenItemIsNotDefined()
-    {
-        $data = new ValidationData(1);
-
-        $this->assertFalse($data->has('test'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::get
-     */
-    public function getShouldReturnTheItemValue()
-    {
-        $data = new ValidationData(1);
-
-        $this->assertEquals(1, $data->get('iat'));
-    }
-
-    /**
-     * @test
-     *
-     * @uses Lcobucci\JWT\ValidationData::__construct
-     * @uses Lcobucci\JWT\ValidationData::setCurrentTime
-     *
-     * @covers Lcobucci\JWT\ValidationData::get
-     */
-    public function getShouldReturnNullWhenItemIsNotDefined()
-    {
-        $data = new ValidationData(1);
-
-        $this->assertNull($data->get('test'));
-    }
-
-    /**
-     * @return array
-     */
-    public function claimValues()
-    {
-        return [
-            [1],
-            ['test']
-        ];
-    }
-
-    /**
-     * @param string|null $id
-     * @param string|null $sub
-     * @param string|null $iss
-     * @param string|null $aud
-     * @param int $iat
-     * @param int|null $nbf
-     * @param int|null $exp
-     *
-     * @return array
-     */
-    private function createExpectedData(
-        $id = null,
-        $sub = null,
-        $iss = null,
-        $aud = null,
-        $iat = 1,
-        $nbf = null,
-        $exp = null
-    ) {
-        return [
-            'jti' => $id !== null ? (string) $id : null,
-            'iss' => $iss !== null ? (string) $iss : null,
-            'aud' => $aud !== null ? (string) $aud : null,
-            'sub' => $sub !== null ? (string) $sub : null,
-            'iat' => $iat,
-            'nbf' => $nbf !== null ? $nbf: $iat,
-            'exp' => $exp !== null ? $exp: $iat
-        ];
-    }
-}

+ 8 - 0
vendor/qeq66/jwt/test/functional/ecdsa/private2.key

@@ -0,0 +1,8 @@
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEIM6G7WZ6SqoPwrHwGXhOJkYD+ErT8dfRvrNifgBQvSb7oAoGCCqGSM49
+AwEHoUQDQgAE09Hkp/u0tIGdzlQ99R/sXCOr9DTZAfLex4D4Po0C1L3qUqHrzZ0m
+B3bAhe+pwEDQ/jqVqdzxhA9i4PqT7F4Aew==
+-----END EC PRIVATE KEY-----