diff --git a/src/Grant/DeviceCode.php b/src/Grant/DeviceCode.php new file mode 100644 index 00000000..b6dd4ec2 --- /dev/null +++ b/src/Grant/DeviceCode.php @@ -0,0 +1,35 @@ + 'mock_device_code']], + ]; + } + + protected function getParamExpectation() + { + return function ($body) { + return !empty($body['grant_type']) + && $body['grant_type'] === 'urn:ietf:params:oauth:grant-type:device_code' + && !empty($body['device_code']); + }; + } + + public function testToString() + { + $grant = new DeviceCode(); + $this->assertEquals('urn:ietf:params:oauth:grant-type:device_code', (string) $grant); + } + + public function testInvalidDeviceCode() + { + $this->expectException(BadMethodCallException::class); + + $this->getMockProvider()->getAccessToken('device_code', ['invalid_device_code' => 'mock_device_code']); + } + +}