grant = new class extends GrantAbstract { protected function getName() : string { return 'TestGrant'; } protected function getRequiredRequestParameters() : array { return ['test']; } }; } 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' ] ) ); } public function testMissingDefaultOption() : void { $this->expectException(\Exception::class); $this->grant->prepareRequestParamters( [ 'something' => 'value' ], [ 'option' => '2', ] ); } }