Skip to content

Commit d639d32

Browse files
committed
Use expectException() rather than annotation
1 parent d68fee6 commit d639d32

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

tests/PhpRendererTest.php

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ public function testExceptionInTemplate()
8686
$this->assertEquals("Hi", $newResponse->getBody()->getContents());
8787
}
8888

89-
/**
90-
* @expectedException InvalidArgumentException
91-
*/
9289
public function testExceptionForTemplateInData()
9390
{
9491
$renderer = new PhpRenderer(__DIR__ . "/_files/");
@@ -97,23 +94,21 @@ public function testExceptionForTemplateInData()
9794
$body = new Stream(fopen('php://temp', 'r+'));
9895
$response = new Response(200, $headers, $body);
9996

97+
$this->expectException(InvalidArgumentException::class);
10098
$renderer->render($response, "template.phtml", [
10199
"template" => "Hi"
102100
]);
103101
}
104102

105-
/**
106-
* @expectedException RuntimeException
107-
*/
108103
public function testTemplateNotFound()
109104
{
110-
111105
$renderer = new PhpRenderer(__DIR__ . "/_files/");
112106

113107
$headers = new Headers();
114108
$body = new Stream(fopen('php://temp', 'r+'));
115109
$response = new Response(200, $headers, $body);
116110

111+
$this->expectException(RuntimeException::class);
117112
$renderer->render($response, "adfadftemplate.phtml", []);
118113
}
119114

@@ -174,20 +169,11 @@ public function testExceptionInLayout()
174169
$this->assertEquals("Hi", $newResponse->getBody()->getContents());
175170
}
176171

177-
/**
178-
* @expectedException RuntimeException
179-
*/
180172
public function testLayoutNotFound()
181173
{
182-
183174
$renderer = new PhpRenderer(__DIR__ . "/_files/");
175+
$this->expectException(RuntimeException::class);
184176
$renderer->setLayout("non-existent_layout.phtml");
185-
186-
$headers = new Headers();
187-
$body = new Stream(fopen('php://temp', 'r+'));
188-
$response = new Response(200, $headers, $body);
189-
190-
$renderer->render($response, "template.phtml", []);
191177
}
192178

193179
public function testContentDataKeyShouldBeIgnored()

0 commit comments

Comments
 (0)