grant = new class() extends GrantAbstract { protected function getName() : string { return 'TestGrant'; } protected function getRequiredRequestParameters() : array { return ['test']; } }; } /** * @covers phpOMS\Auth\OAuth2\Grant\GrantAbstract * @group framework */ public function testDefault() : void { self::assertEquals('TestGrant', $this->grant->__toString()); self::assertEquals( [ 'test' => 'value2', 'option' => '2', ], $this->grant->prepareRequestParamters( [ 'test' => 'value', ], [ 'option' => '2', 'test' => 'value2', ] ) ); } /** * @covers phpOMS\Auth\OAuth2\Grant\GrantAbstract * @group framework */ public function testMissingDefaultOption() : void { $this->expectException(\Exception::class); $this->grant->prepareRequestParamters( [ 'something' => 'value', ], [ 'option' => '2', ] ); } }