-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Orchestra\Testbench\TestCaseInterface.
Signed-off-by: crynobone <crynobone@gmail.com>
- Loading branch information
Showing
3 changed files
with
234 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
<?php namespace Orchestra\Testbench; | ||
|
||
use Illuminate\Auth\UserInterface; | ||
|
||
interface TestCaseInterface | ||
{ | ||
/** | ||
* Assert that the session has a given list of values. | ||
* | ||
* @param array $bindings | ||
* @return void | ||
*/ | ||
public function assertSessionHasAll(array $bindings); | ||
|
||
/** | ||
* Setup the test environment. | ||
* | ||
* @return void | ||
*/ | ||
public function setUp(); | ||
|
||
/** | ||
* Call the given URI and return the Response. | ||
* | ||
* @param string $method | ||
* @param string $uri | ||
* @param array $parameters | ||
* @param array $files | ||
* @param array $server | ||
* @param string $content | ||
* @param bool $changeHistory | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function call(); | ||
|
||
/** | ||
* Call a controller action and return the Response. | ||
* | ||
* @param string $method | ||
* @param string $action | ||
* @param array $wildcards | ||
* @param array $parameters | ||
* @param array $files | ||
* @param array $server | ||
* @param string $content | ||
* @param bool $changeHistory | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function action( | ||
$method, | ||
$action, | ||
$wildcards = array(), | ||
$parameters = array(), | ||
$files = array(), | ||
$server = array(), | ||
$content = null, | ||
$changeHistory = true | ||
); | ||
|
||
/** | ||
* Assert that the session has old input. | ||
* | ||
* @return void | ||
*/ | ||
public function assertHasOldInput(); | ||
|
||
/** | ||
* Assert that the response view has a given piece of bound data. | ||
* | ||
* @param string|array $key | ||
* @param mixed $value | ||
* @return void | ||
*/ | ||
public function assertViewHas($key, $value = null); | ||
|
||
/** | ||
* Assert that the client response has a given code. | ||
* | ||
* @param int $code | ||
* @return void | ||
*/ | ||
public function assertResponseStatus($code); | ||
|
||
/** | ||
* Call a named route and return the Response. | ||
* | ||
* @param string $method | ||
* @param string $name | ||
* @param array $routeParameters | ||
* @param array $parameters | ||
* @param array $files | ||
* @param array $server | ||
* @param string $content | ||
* @param bool $changeHistory | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function route( | ||
$method, | ||
$name, | ||
$routeParameters = array(), | ||
$parameters = array(), | ||
$files = array(), | ||
$server = array(), | ||
$content = null, | ||
$changeHistory = true | ||
); | ||
|
||
/** | ||
* Assert that the session has a given list of values. | ||
* | ||
* @param string|array $key | ||
* @param mixed $value | ||
* @return void | ||
*/ | ||
public function assertSessionHas($key, $value = null); | ||
|
||
/** | ||
* Assert whether the client was redirected to a given URI. | ||
* | ||
* @param string $uri | ||
* @param array $with | ||
* @return void | ||
*/ | ||
public function assertRedirectedTo($uri, $with = array()); | ||
|
||
/** | ||
* Set the session to the given array. | ||
* | ||
* @param array $data | ||
* @return void | ||
*/ | ||
public function session(array $data); | ||
|
||
/** | ||
* Creates the application. | ||
* | ||
* Needs to be implemented by subclasses. | ||
* | ||
* @return \Symfony\Component\HttpKernel\HttpKernelInterface | ||
*/ | ||
public function createApplication(); | ||
|
||
/** | ||
* Assert that the client response has an OK status code. | ||
* | ||
* @return void | ||
*/ | ||
public function assertResponseOk(); | ||
|
||
/** | ||
* Assert whether the client was redirected to a given action. | ||
* | ||
* @param string $name | ||
* @param array $parameters | ||
* @param array $with | ||
* @return void | ||
*/ | ||
public function assertRedirectedToAction($name, $parameters = array(), $with = array()); | ||
|
||
/** | ||
* Set the currently logged in user for the application. | ||
* | ||
* @param \Illuminate\Auth\UserInterface $user | ||
* @param string $driver | ||
* @return void | ||
*/ | ||
public function be(UserInterface $user, $driver = null); | ||
|
||
/** | ||
* Assert that the session has errors bound. | ||
* | ||
* @param string|array $bindings | ||
* @param mixed $format | ||
* @return void | ||
*/ | ||
public function assertSessionHasErrors($bindings = array(), $format = null); | ||
|
||
/** | ||
* Assert that the response view is missing a piece of bound data. | ||
* | ||
* @param string $key | ||
* @return void | ||
*/ | ||
public function assertViewMissing($key); | ||
|
||
/** | ||
* Seed a given database connection. | ||
* | ||
* @param string $class | ||
* @return void | ||
*/ | ||
public function seed($class = 'DatabaseSeeder'); | ||
|
||
/** | ||
* Call the given HTTPS URI and return the Response. | ||
* | ||
* @param string $method | ||
* @param string $uri | ||
* @param array $parameters | ||
* @param array $files | ||
* @param array $server | ||
* @param string $content | ||
* @param bool $changeHistory | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function callSecure(); | ||
|
||
/** | ||
* Assert whether the client was redirected to a given route. | ||
* | ||
* @param string $name | ||
* @param array $parameters | ||
* @param array $with | ||
* @return void | ||
*/ | ||
public function assertRedirectedToRoute($name, $parameters = array(), $with = array()); | ||
|
||
/** | ||
* Flush all of the current session data. | ||
* | ||
* @return void | ||
*/ | ||
public function flushSession(); | ||
|
||
/** | ||
* Assert that the view has a given list of bound data. | ||
* | ||
* @param array $bindings | ||
* @return void | ||
*/ | ||
public function assertViewHasAll(array $bindings); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters