| @@ 26-33 (lines=8) @@ | ||
| 23 | /** |
|
| 24 | * @covers \Tfboe\FmLib\Entity\Helpers\NumericalId::getId |
|
| 25 | */ |
|
| 26 | public function testId() |
|
| 27 | { |
|
| 28 | $player = $this->player(); |
|
| 29 | /** @noinspection PhpUnhandledExceptionInspection */ |
|
| 30 | $idProperty = self::getProperty(get_class($player), 'id'); |
|
| 31 | $idProperty->setValue($player, 0); |
|
| 32 | self::assertEquals(0, $player->getId()); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @covers \Tfboe\FmLib\Entity\Helpers\NumericalId::getEntityId |
|
| @@ 38-45 (lines=8) @@ | ||
| 35 | /** |
|
| 36 | * @covers \Tfboe\FmLib\Entity\Helpers\NumericalId::getEntityId |
|
| 37 | */ |
|
| 38 | public function testEntityId() |
|
| 39 | { |
|
| 40 | $player = $this->player(); |
|
| 41 | /** @noinspection PhpUnhandledExceptionInspection */ |
|
| 42 | $idProperty = self::getProperty(get_class($player), 'id'); |
|
| 43 | $idProperty->setValue($player, 1); |
|
| 44 | self::assertEquals(1, $player->getEntityId()); |
|
| 45 | } |
|
| 46 | //</editor-fold desc="Public Methods"> |
|
| 47 | ||
| 48 | //<editor-fold desc="Private Methods"> |
|
| @@ 29-35 (lines=7) @@ | ||
| 26 | * @covers \Tfboe\FmLib\Entity\Helpers\UUIDEntity::getId |
|
| 27 | * @uses \Tfboe\FmLib\Entity\Helpers\IdGenerator::createIdFrom |
|
| 28 | */ |
|
| 29 | public function testId() |
|
| 30 | { |
|
| 31 | $entity = $this->mock(); |
|
| 32 | /** @noinspection PhpUnhandledExceptionInspection */ |
|
| 33 | self::getProperty(get_class($entity), 'id')->setValue($entity, 'test-id'); |
|
| 34 | self::assertEquals('test-id', $entity->getId()); |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * @covers \Tfboe\FmLib\Entity\Helpers\UUIDEntity::getEntityId |
|
| @@ 41-47 (lines=7) @@ | ||
| 38 | * @covers \Tfboe\FmLib\Entity\Helpers\UUIDEntity::getEntityId |
|
| 39 | * @uses \Tfboe\FmLib\Entity\Helpers\IdGenerator::createIdFrom |
|
| 40 | */ |
|
| 41 | public function testEntityId() |
|
| 42 | { |
|
| 43 | $entity = $this->mock(); |
|
| 44 | /** @noinspection PhpUnhandledExceptionInspection */ |
|
| 45 | self::getProperty(get_class($entity), 'id')->setValue($entity, 'test-id'); |
|
| 46 | self::assertEquals('test-id', $entity->getEntityId()); |
|
| 47 | } |
|
| 48 | //</editor-fold desc="Public Methods"> |
|
| 49 | ||
| 50 | //<editor-fold desc="Private Methods"> |
|
| @@ 67-74 (lines=8) @@ | ||
| 64 | * @uses \Tfboe\FmLib\Entity\Traits\User::init |
|
| 65 | * @uses \Tfboe\FmLib\Entity\Helpers\UUIDEntity::getId |
|
| 66 | */ |
|
| 67 | public function testJWTIdentifier() |
|
| 68 | { |
|
| 69 | $user = $this->user(); |
|
| 70 | /** @noinspection PhpUnhandledExceptionInspection */ |
|
| 71 | self::getProperty(get_class($user), 'id')->setValue($user, 'user-id'); |
|
| 72 | self::assertEquals('user-id', $user->getJWTIdentifier()); |
|
| 73 | self::assertEquals($user->getId(), $user->getJWTIdentifier()); |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * @covers \Tfboe\FmLib\Entity\Traits\User::getJwtVersion() |
|