@@ -15,8 +15,7 @@ |
||
| 15 | 15 | use MaxBeckers\AmazonAlexa\Response\Directives\Display\TextContent; |
| 16 | 16 | use PHPUnit\Framework\TestCase; |
| 17 | 17 | |
| 18 | -class DisplayTest extends TestCase |
|
| 19 | -{ |
|
| 18 | +class DisplayTest extends TestCase { |
|
| 20 | 19 | public function testText(): void |
| 21 | 20 | { |
| 22 | 21 | $text = Text::create('Test'); |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | use MaxBeckers\AmazonAlexa\Response\Directives\GameEngine\StopInputHandlerDirective; |
| 14 | 14 | use PHPUnit\Framework\TestCase; |
| 15 | 15 | |
| 16 | -class GameEngineTest extends TestCase |
|
| 17 | -{ |
|
| 16 | +class GameEngineTest extends TestCase { |
|
| 18 | 17 | public function testStartInputHandlerDirective(): void |
| 19 | 18 | { |
| 20 | 19 | $pattern = Pattern::create(Pattern::ACTION_UP, ['gadgetId1', 'gadgetId2'], ['blue']); |
@@ -11,8 +11,7 @@ |
||
| 11 | 11 | use MaxBeckers\AmazonAlexa\Response\Directives\Display\TextContent; |
| 12 | 12 | use PHPUnit\Framework\TestCase; |
| 13 | 13 | |
| 14 | -class TemplateTest extends TestCase |
|
| 15 | -{ |
|
| 14 | +class TemplateTest extends TestCase { |
|
| 16 | 15 | public function testSerializeTypeAndToken(): void |
| 17 | 16 | { |
| 18 | 17 | $type = 'BodyTemplate1'; |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | use MaxBeckers\AmazonAlexa\Response\Directives\Display\TextContent; |
| 10 | 10 | use PHPUnit\Framework\TestCase; |
| 11 | 11 | |
| 12 | -class TextContentTest extends TestCase |
|
| 13 | -{ |
|
| 12 | +class TextContentTest extends TestCase { |
|
| 14 | 13 | public function testSerializePrimaryOnly(): void |
| 15 | 14 | { |
| 16 | 15 | $primaryText = Text::create('primaryText'); |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | use MaxBeckers\AmazonAlexa\Response\Directives\VideoApp\VideoLaunchDirective; |
| 10 | 10 | use PHPUnit\Framework\TestCase; |
| 11 | 11 | |
| 12 | -class VideoAppTest extends TestCase |
|
| 13 | -{ |
|
| 12 | +class VideoAppTest extends TestCase { |
|
| 14 | 13 | public function testMetadata(): void |
| 15 | 14 | { |
| 16 | 15 | $meta = Metadata::create(); |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | use MaxBeckers\AmazonAlexa\Response\CardImage; |
| 11 | 11 | use PHPUnit\Framework\TestCase; |
| 12 | 12 | |
| 13 | -class CardTest extends TestCase |
|
| 14 | -{ |
|
| 13 | +class CardTest extends TestCase { |
|
| 15 | 14 | public function testSimpleCard(): void |
| 16 | 15 | { |
| 17 | 16 | $title = 'title'; |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | use MaxBeckers\AmazonAlexa\Response\OutputSpeech; |
| 11 | 11 | use PHPUnit\Framework\TestCase; |
| 12 | 12 | |
| 13 | -class ResponseHelperTest extends TestCase |
|
| 14 | -{ |
|
| 13 | +class ResponseHelperTest extends TestCase { |
|
| 15 | 14 | private const RESPOND = 'Respond'; |
| 16 | 15 | private const REPROMPT = 'Reprompt'; |
| 17 | 16 | |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | use MaxBeckers\AmazonAlexa\Response\CanFulfill\CanFulfillSlot; |
| 10 | 10 | use PHPUnit\Framework\TestCase; |
| 11 | 11 | |
| 12 | -class CanFulfillResponseBodyTest extends TestCase |
|
| 13 | -{ |
|
| 12 | +class CanFulfillResponseBodyTest extends TestCase { |
|
| 14 | 13 | public function testJsonSerialize(): void |
| 15 | 14 | { |
| 16 | 15 | $slot1 = CanFulfillSlot::create(CanFulfillSlot::CAN_UNDERSTAND_YES, CanFulfillSlot::CAN_FULFILL_YES); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $requestValidator = new RequestValidator(RequestValidator::TIMESTAMP_VALID_TOLERANCE_SECONDS, $client); |
| 55 | 55 | |
| 56 | 56 | $client->method('request') |
| 57 | - ->willReturn($apiResponse); |
|
| 57 | + ->willReturn($apiResponse); |
|
| 58 | 58 | $apiResponse->method('getStatusCode') |
| 59 | 59 | ->willReturn(200); |
| 60 | 60 | $apiResponse->method('getBody') |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $requestValidator = new RequestValidator(RequestValidator::TIMESTAMP_VALID_TOLERANCE_SECONDS, $client); |
| 83 | 83 | |
| 84 | 84 | $client->method('request') |
| 85 | - ->willReturn($apiResponse); |
|
| 85 | + ->willReturn($apiResponse); |
|
| 86 | 86 | $apiResponse->method('getStatusCode') |
| 87 | 87 | ->willReturn(400); |
| 88 | 88 | |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | use Psr\Http\Message\ResponseInterface; |
| 15 | 15 | use Psr\Http\Message\StreamInterface; |
| 16 | 16 | |
| 17 | -class RequestValidatorTest extends TestCase |
|
| 18 | -{ |
|
| 17 | +class RequestValidatorTest extends TestCase { |
|
| 19 | 18 | public function testInvalidRequestTime(): void |
| 20 | 19 | { |
| 21 | 20 | $requestValidator = new RequestValidator(); |
@@ -112,8 +111,7 @@ discard block |
||
| 112 | 111 | |
| 113 | 112 | // validateSignature will fail (no real cert), so disable signature path by overriding property |
| 114 | 113 | $intentWithNoSignature = new class ($intent) extends IntentRequest { |
| 115 | - public function __construct(IntentRequest $base) |
|
| 116 | - { |
|
| 114 | + public function __construct(IntentRequest $base) { |
|
| 117 | 115 | $this->timestamp = $base->timestamp; |
| 118 | 116 | $this->type = $base->type; |
| 119 | 117 | } |
@@ -138,8 +136,7 @@ discard block |
||
| 138 | 136 | $r = new Request(); |
| 139 | 137 | $r->request = $intent; |
| 140 | 138 | $intent = new class ($intent) extends IntentRequest { |
| 141 | - public function __construct(IntentRequest $base) |
|
| 142 | - { |
|
| 139 | + public function __construct(IntentRequest $base) { |
|
| 143 | 140 | $this->timestamp = $base->timestamp; |
| 144 | 141 | $this->type = $base->type; |
| 145 | 142 | } |
@@ -172,8 +169,7 @@ discard block |
||
| 172 | 169 | { |
| 173 | 170 | $validator = new RequestValidator(); |
| 174 | 171 | $intent = new class () extends IntentRequest { |
| 175 | - public function __construct() |
|
| 176 | - { |
|
| 172 | + public function __construct() { |
|
| 177 | 173 | $this->timestamp = new \DateTime('-5 hours'); // would normally fail |
| 178 | 174 | $this->type = 'test'; |
| 179 | 175 | } |
@@ -201,8 +197,7 @@ discard block |
||
| 201 | 197 | $validator = new RequestValidator(RequestValidator::TIMESTAMP_VALID_TOLERANCE_SECONDS, $client); |
| 202 | 198 | |
| 203 | 199 | $intent = new class () extends IntentRequest { |
| 204 | - public function __construct() |
|
| 205 | - { |
|
| 200 | + public function __construct() { |
|
| 206 | 201 | $this->timestamp = new \DateTime(); |
| 207 | 202 | $this->type = 'test'; |
| 208 | 203 | } |
@@ -235,8 +230,7 @@ discard block |
||
| 235 | 230 | $validator = new RequestValidator(RequestValidator::TIMESTAMP_VALID_TOLERANCE_SECONDS, $client); |
| 236 | 231 | |
| 237 | 232 | $intent = new class () extends IntentRequest { |
| 238 | - public function __construct() |
|
| 239 | - { |
|
| 233 | + public function __construct() { |
|
| 240 | 234 | $this->timestamp = new \DateTime(); |
| 241 | 235 | $this->type = 'test'; |
| 242 | 236 | } |
@@ -268,8 +262,7 @@ discard block |
||
| 268 | 262 | $validator = new RequestValidator(RequestValidator::TIMESTAMP_VALID_TOLERANCE_SECONDS, $client); |
| 269 | 263 | |
| 270 | 264 | $intent = new class () extends IntentRequest { |
| 271 | - public function __construct() |
|
| 272 | - { |
|
| 265 | + public function __construct() { |
|
| 273 | 266 | $this->timestamp = new \DateTime(); |
| 274 | 267 | $this->type = 'test'; |
| 275 | 268 | } |