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
758603dc
Commit
758603dc
authored
Mar 22, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move some parts around
parent
595c8531
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
40 deletions
+40
-40
tests/Silex/Tests/BeforeAfterFilterTest.php
tests/Silex/Tests/BeforeAfterFilterTest.php
+7
-7
tests/Silex/Tests/ErrorHandlerTest.php
tests/Silex/Tests/ErrorHandlerTest.php
+7
-7
tests/Silex/Tests/FrameworkTest.php
tests/Silex/Tests/FrameworkTest.php
+5
-5
tests/Silex/Tests/RouterTest.php
tests/Silex/Tests/RouterTest.php
+16
-16
tests/Silex/Tests/WebTestCaseTest.php
tests/Silex/Tests/WebTestCaseTest.php
+5
-5
No files found.
tests/Silex/Tests/BeforeAfterFilterTest.php
View file @
758603dc
<?php
<?php
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
/*
/*
* This file is part of the Silex framework.
* This file is part of the Silex framework.
*
*
...
@@ -16,6 +9,13 @@ use Symfony\Component\HttpFoundation\Response;
...
@@ -16,6 +9,13 @@ use Symfony\Component\HttpFoundation\Response;
* with this source code in the file LICENSE.
* with this source code in the file LICENSE.
*/
*/
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
/**
/**
* Error handler test cases.
* Error handler test cases.
*
*
...
...
tests/Silex/Tests/ErrorHandlerTest.php
View file @
758603dc
<?php
<?php
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
/*
/*
* This file is part of the Silex framework.
* This file is part of the Silex framework.
*
*
...
@@ -16,6 +9,13 @@ use Symfony\Component\HttpFoundation\Response;
...
@@ -16,6 +9,13 @@ use Symfony\Component\HttpFoundation\Response;
* with this source code in the file LICENSE.
* with this source code in the file LICENSE.
*/
*/
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
/**
/**
* Error handler test cases.
* Error handler test cases.
*
*
...
...
tests/Silex/Tests/FrameworkTest.php
View file @
758603dc
<?php
<?php
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
/*
/*
* This file is part of the Silex framework.
* This file is part of the Silex framework.
*
*
...
@@ -14,6 +9,11 @@ use Symfony\Component\HttpFoundation\Request;
...
@@ -14,6 +9,11 @@ use Symfony\Component\HttpFoundation\Request;
* with this source code in the file LICENSE.
* with this source code in the file LICENSE.
*/
*/
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
/**
/**
* Framework test cases.
* Framework test cases.
*
*
...
...
tests/Silex/Tests/RouterTest.php
View file @
758603dc
<?php
<?php
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
/*
/*
* This file is part of the Silex framework.
* This file is part of the Silex framework.
*
*
...
@@ -18,6 +9,15 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
...
@@ -18,6 +9,15 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* with this source code in the file LICENSE.
* with this source code in the file LICENSE.
*/
*/
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpKernel\Exception\NotFoundHttpException
;
/**
/**
* Router test cases.
* Router test cases.
*
*
...
@@ -136,13 +136,6 @@ class RouterTest extends \PHPUnit_Framework_TestCase
...
@@ -136,13 +136,6 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$this
->
checkRouteResponse
(
$framework
,
'/resource'
,
'delete resource'
,
'delete'
);
$this
->
checkRouteResponse
(
$framework
,
'/resource'
,
'delete resource'
,
'delete'
);
}
}
protected
function
checkRouteResponse
(
$framework
,
$path
,
$expectedContent
,
$method
=
'get'
,
$message
=
null
)
{
$request
=
Request
::
create
(
$path
,
$method
);
$response
=
$framework
->
handle
(
$request
);
$this
->
assertEquals
(
$expectedContent
,
$response
->
getContent
(),
$message
);
}
public
function
testRequestShouldBeStoredRegardlessOfRouting
()
{
public
function
testRequestShouldBeStoredRegardlessOfRouting
()
{
$framework
=
new
Framework
();
$framework
=
new
Framework
();
$framework
->
get
(
'/foo'
,
function
()
use
(
$framework
)
{
$framework
->
get
(
'/foo'
,
function
()
use
(
$framework
)
{
...
@@ -157,4 +150,11 @@ class RouterTest extends \PHPUnit_Framework_TestCase
...
@@ -157,4 +150,11 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$this
->
assertContains
(
$path
,
$response
->
getContent
());
$this
->
assertContains
(
$path
,
$response
->
getContent
());
}
}
}
}
protected
function
checkRouteResponse
(
$framework
,
$path
,
$expectedContent
,
$method
=
'get'
,
$message
=
null
)
{
$request
=
Request
::
create
(
$path
,
$method
);
$response
=
$framework
->
handle
(
$request
);
$this
->
assertEquals
(
$expectedContent
,
$response
->
getContent
(),
$message
);
}
}
}
tests/Silex/Tests/WebTestCaseTest.php
View file @
758603dc
<?php
<?php
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Silex\WebTestCase
;
/*
/*
* This file is part of the Silex framework.
* This file is part of the Silex framework.
*
*
...
@@ -14,6 +9,11 @@ use Silex\WebTestCase;
...
@@ -14,6 +9,11 @@ use Silex\WebTestCase;
* with this source code in the file LICENSE.
* with this source code in the file LICENSE.
*/
*/
namespace
Silex\Tests
;
use
Silex\Framework
;
use
Silex\WebTestCase
;
/**
/**
* Functional test cases.
* Functional test cases.
*
*
...
...
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