Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
d2c42b32
Commit
d2c42b32
authored
Dec 12, 2012
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ErrorHandlerTest to ExceptionHandlerTest
parent
0e69dc22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
tests/Silex/Tests/ExceptionHandlerTest.php
tests/Silex/Tests/ExceptionHandlerTest.php
+18
-18
No files found.
tests/Silex/Tests/E
rror
HandlerTest.php
→
tests/Silex/Tests/E
xception
HandlerTest.php
View file @
d2c42b32
...
@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
...
@@ -22,9 +22,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
*
*
* @author Igor Wiedler <igor@wiedler.ch>
* @author Igor Wiedler <igor@wiedler.ch>
*/
*/
class
E
rror
HandlerTest
extends
\PHPUnit_Framework_TestCase
class
E
xception
HandlerTest
extends
\PHPUnit_Framework_TestCase
{
{
public
function
testE
rror
HandlerExceptionNoDebug
()
public
function
testE
xception
HandlerExceptionNoDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -39,7 +39,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -39,7 +39,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
}
}
public
function
testE
rror
HandlerExceptionDebug
()
public
function
testE
xception
HandlerExceptionDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
true
;
$app
[
'debug'
]
=
true
;
...
@@ -55,7 +55,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -55,7 +55,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
}
}
public
function
testE
rror
HandlerNotFoundNoDebug
()
public
function
testE
xception
HandlerNotFoundNoDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -66,7 +66,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -66,7 +66,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
404
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
404
,
$response
->
getStatusCode
());
}
}
public
function
testE
rror
HandlerNotFoundDebug
()
public
function
testE
xception
HandlerNotFoundDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
true
;
$app
[
'debug'
]
=
true
;
...
@@ -77,7 +77,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -77,7 +77,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
404
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
404
,
$response
->
getStatusCode
());
}
}
public
function
testE
rror
HandlerMethodNotAllowedNoDebug
()
public
function
testE
xception
HandlerMethodNotAllowedNoDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -91,7 +91,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -91,7 +91,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
}
}
public
function
testE
rror
HandlerMethodNotAllowedDebug
()
public
function
testE
xception
HandlerMethodNotAllowedDebug
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
true
;
$app
[
'debug'
]
=
true
;
...
@@ -105,7 +105,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -105,7 +105,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
}
}
public
function
testNoE
rror
Handler
()
public
function
testNoE
xception
Handler
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
();
$app
[
'exception_handler'
]
->
disable
();
...
@@ -123,7 +123,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -123,7 +123,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
}
}
}
}
public
function
testOneE
rror
Handler
()
public
function
testOneE
xception
Handler
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
...
@@ -152,7 +152,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -152,7 +152,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
$this
->
assertEquals
(
'GET'
,
$response
->
headers
->
get
(
'Allow'
));
}
}
public
function
testMultipleE
rror
Handlers
()
public
function
testMultipleE
xception
Handlers
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
...
@@ -187,7 +187,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -187,7 +187,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
3
,
$errors
,
'should execute error handlers until a response is returned'
);
$this
->
assertEquals
(
3
,
$errors
,
'should execute error handlers until a response is returned'
);
}
}
public
function
testNoResponseE
rror
Handler
()
public
function
testNoResponseE
xception
Handler
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'exception_handler'
]
->
disable
();
$app
[
'exception_handler'
]
->
disable
();
...
@@ -213,7 +213,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -213,7 +213,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
1
,
$errors
,
'should execute the error handler'
);
$this
->
assertEquals
(
1
,
$errors
,
'should execute the error handler'
);
}
}
public
function
testStringResponseE
rror
Handler
()
public
function
testStringResponseE
xception
Handler
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
...
@@ -229,7 +229,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -229,7 +229,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
checkRouteResponse
(
$app
,
'/foo'
,
'foo exception handler'
,
'should accept a string response from the error handler'
);
$this
->
checkRouteResponse
(
$app
,
'/foo'
,
'foo exception handler'
,
'should accept a string response from the error handler'
);
}
}
public
function
testE
rror
HandlerException
()
public
function
testE
xception
HandlerException
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
...
@@ -273,7 +273,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -273,7 +273,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
}
}
}
}
public
function
testE
rror
HandlerWithDefaultException
()
public
function
testE
xception
HandlerWithDefaultException
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -292,7 +292,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -292,7 +292,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
$this
->
assertEquals
(
500
,
$response
->
getStatusCode
());
}
}
public
function
testE
rror
HandlerWithStandardException
()
public
function
testE
xception
HandlerWithStandardException
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -318,7 +318,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -318,7 +318,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertContains
(
'Caught Exception'
,
$response
->
getContent
());
$this
->
assertContains
(
'Caught Exception'
,
$response
->
getContent
());
}
}
public
function
testE
rror
HandlerWithSpecifiedException
()
public
function
testE
xception
HandlerWithSpecifiedException
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -344,7 +344,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -344,7 +344,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertContains
(
'Caught LogicException'
,
$response
->
getContent
());
$this
->
assertContains
(
'Caught LogicException'
,
$response
->
getContent
());
}
}
public
function
testE
rror
HandlerWithSpecifiedExceptionInReverseOrder
()
public
function
testE
xception
HandlerWithSpecifiedExceptionInReverseOrder
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
@@ -372,7 +372,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
...
@@ -372,7 +372,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$this
->
assertContains
(
'Caught Exception'
,
$response
->
getContent
());
$this
->
assertContains
(
'Caught Exception'
,
$response
->
getContent
());
}
}
public
function
testE
rror
HandlerWithArrayStyleCallback
()
public
function
testE
xception
HandlerWithArrayStyleCallback
()
{
{
$app
=
new
Application
();
$app
=
new
Application
();
$app
[
'debug'
]
=
false
;
$app
[
'debug'
]
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment