mirror of
https://github.com/flarum/core.git
synced 2025-07-31 21:50:50 +02:00
Upgrade to L5 + huge refactor + more. closes #2
New stuff: - Signup + email confirmation. - Updated authentication strategy with remember cookies. closes #5 - New search system with some example gambits! This is cool - check out the source. Fulltext drivers will be implemented as decorators overriding the EloquentPostRepository’s findByContent method. - Lay down the foundation for bootstrapping the Ember app. - Update Web layer’s asset manager to properly publish CSS/JS files. - Console commands to run installation migrations and seeds. Refactoring: - New structure: move models, repositories, commands, and events into their own namespaces, rather than grouping by entity. - All events are classes. - Use L5 middleware and command bus implementations. - Clearer use of repositories and the Active Record pattern. Repositories are used only for retrieval of ActiveRecord objects, and then save/delete operations are called directly on those ActiveRecords. This way, we don’t over-abstract at the cost of Eloquent magic, but testing is still easy. - Refactor of Web layer so that it uses the Actions routing architecture. - “Actor” concept instead of depending on Laravel’s Auth. - General cleanup!
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Laracasts\TestDummy\Factory;
|
||||
use \Mockery as m;
|
||||
use Flarum\Core\Users\User;
|
||||
use Flarum\Core\Discussions\Discussion;
|
||||
use Flarum\Core\Discussions\DiscussionRepository;
|
||||
use Codeception\Util\Stub;
|
||||
|
||||
class DiscussionRepositoryTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
/**
|
||||
* @var \IntegrationTester
|
||||
*/
|
||||
protected $tester;
|
||||
|
||||
protected function _before()
|
||||
{
|
||||
$this->repo = new DiscussionRepository;
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function testGetDiscussionByID()
|
||||
{
|
||||
// Given I have a discussion
|
||||
$discussion = Factory::create('Flarum\Core\Discussions\Discussion');
|
||||
|
||||
// When I fetch the discussion by its ID
|
||||
$result = $this->repo->find($discussion->id);
|
||||
|
||||
// Then I should receive it
|
||||
$this->assertEquals($discussion->id, $result->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function testDiscussionCannotBeViewed()
|
||||
{
|
||||
// Given I have a discussion
|
||||
$discussion = Factory::create('Flarum\Core\Discussions\Discussion');
|
||||
|
||||
// And forum permissions do not allow guests to view the forum
|
||||
$manager = m::mock('Flarum\Core\Permissions\Manager');
|
||||
$manager->shouldReceive('granted')->andReturn(false);
|
||||
app()->instance('flarum.permissions', $manager);
|
||||
|
||||
// When I fetch the discussion by its ID, I expect an exception to be thrown
|
||||
$this->repo->findOrFail($discussion->id, new Flarum\Core\Users\Guest);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function testSaveDiscussion()
|
||||
{
|
||||
// Given I have a new discussion
|
||||
$user = Factory::create('Flarum\Core\Users\User');
|
||||
$discussion = Discussion::start('foo', $user);
|
||||
|
||||
// When I save it
|
||||
$discussion = $this->repo->save($discussion);
|
||||
|
||||
// Then it should be in the database
|
||||
$this->tester->seeRecord('discussions', ['title' => 'foo']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @expectedException Flarum\Core\Support\Exceptions\ValidationFailureException
|
||||
*/
|
||||
public function testSaveInvalidDiscussion()
|
||||
{
|
||||
// Given I have a new discussion containing no information
|
||||
$discussion = new Discussion;
|
||||
|
||||
// When I save it, I expect an exception to be thrown
|
||||
$this->repo->save($discussion);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function testDeleteDiscussion()
|
||||
{
|
||||
// Given I have a discussion
|
||||
$discussion = Factory::create('Flarum\Core\Discussions\Discussion');
|
||||
|
||||
// When I delete it
|
||||
$this->repo->delete($discussion);
|
||||
|
||||
// Then it should no longer be in the database
|
||||
$this->tester->dontSeeRecord('discussions', ['id' => $discussion->id]);
|
||||
}
|
||||
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] 879ecac65759e12fe5ae69eb3feba6b8
|
||||
<?php //[STAMP] 6f66848bf7db9fd98f774b8bf10f73a2
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// You should not change it manually as it will be overwritten on next build
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
use Codeception\Module\IntegrationHelper;
|
||||
use Codeception\Module\Laravel4;
|
||||
use Codeception\Module\Laravel5;
|
||||
use Codeception\Module\Mockery;
|
||||
|
||||
/**
|
||||
@@ -30,22 +30,13 @@ class IntegrationTester extends \Codeception\Actor
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Enable Laravel filters for next requests.
|
||||
* @see \Codeception\Module\Laravel4::haveEnabledFilters()
|
||||
*/
|
||||
public function haveEnabledFilters() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('haveEnabledFilters', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
* Provides access the Laravel application object.
|
||||
*
|
||||
* Disable Laravel filters for next requests.
|
||||
* @see \Codeception\Module\Laravel4::haveDisabledFilters()
|
||||
* @return \Illuminate\Foundation\Application
|
||||
* @see \Codeception\Module\Laravel5::getApplication()
|
||||
*/
|
||||
public function haveDisabledFilters() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('haveDisabledFilters', func_get_args()));
|
||||
public function getApplication() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('getApplication', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +53,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param $route
|
||||
* @param array $params
|
||||
* @see \Codeception\Module\Laravel4::amOnRoute()
|
||||
* @see \Codeception\Module\Laravel5::amOnRoute()
|
||||
*/
|
||||
public function amOnRoute($route, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Condition('amOnRoute', func_get_args()));
|
||||
@@ -82,7 +73,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param $action
|
||||
* @param array $params
|
||||
* @see \Codeception\Module\Laravel4::amOnAction()
|
||||
* @see \Codeception\Module\Laravel5::amOnAction()
|
||||
*/
|
||||
public function amOnAction($action, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Condition('amOnAction', func_get_args()));
|
||||
@@ -102,7 +93,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $route
|
||||
* @param array $params
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeCurrentRouteIs()
|
||||
* @see \Codeception\Module\Laravel5::seeCurrentRouteIs()
|
||||
*/
|
||||
public function canSeeCurrentRouteIs($route, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentRouteIs', func_get_args()));
|
||||
@@ -119,7 +110,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* ```
|
||||
* @param $route
|
||||
* @param array $params
|
||||
* @see \Codeception\Module\Laravel4::seeCurrentRouteIs()
|
||||
* @see \Codeception\Module\Laravel5::seeCurrentRouteIs()
|
||||
*/
|
||||
public function seeCurrentRouteIs($route, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentRouteIs', func_get_args()));
|
||||
@@ -140,7 +131,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $action
|
||||
* @param array $params
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeCurrentActionIs()
|
||||
* @see \Codeception\Module\Laravel5::seeCurrentActionIs()
|
||||
*/
|
||||
public function canSeeCurrentActionIs($action, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentActionIs', func_get_args()));
|
||||
@@ -158,7 +149,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param $action
|
||||
* @param array $params
|
||||
* @see \Codeception\Module\Laravel4::seeCurrentActionIs()
|
||||
* @see \Codeception\Module\Laravel5::seeCurrentActionIs()
|
||||
*/
|
||||
public function seeCurrentActionIs($action, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentActionIs', func_get_args()));
|
||||
@@ -174,7 +165,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeInSession()
|
||||
* @see \Codeception\Module\Laravel5::seeInSession()
|
||||
*/
|
||||
public function canSeeInSession($key, $value = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInSession', func_get_args()));
|
||||
@@ -187,7 +178,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param string|array $key
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
* @see \Codeception\Module\Laravel4::seeInSession()
|
||||
* @see \Codeception\Module\Laravel5::seeInSession()
|
||||
*/
|
||||
public function seeInSession($key, $value = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInSession', func_get_args()));
|
||||
@@ -202,7 +193,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param array $bindings
|
||||
* @return void
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeSessionHasValues()
|
||||
* @see \Codeception\Module\Laravel5::seeSessionHasValues()
|
||||
*/
|
||||
public function canSeeSessionHasValues($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeSessionHasValues', func_get_args()));
|
||||
@@ -214,7 +205,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param array $bindings
|
||||
* @return void
|
||||
* @see \Codeception\Module\Laravel4::seeSessionHasValues()
|
||||
* @see \Codeception\Module\Laravel5::seeSessionHasValues()
|
||||
*/
|
||||
public function seeSessionHasValues($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeSessionHasValues', func_get_args()));
|
||||
@@ -224,74 +215,121 @@ class IntegrationTester extends \Codeception\Actor
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that Session has error messages
|
||||
* The seeSessionHasValues cannot be used, as Message bag Object is returned by Laravel4
|
||||
* Assert that the form errors are bound to the View.
|
||||
*
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeSessionErrorMessage(array('username'=>'Invalid Username'));
|
||||
* ?>
|
||||
* ```
|
||||
* @param array $bindings
|
||||
* @return bool
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeSessionErrorMessage()
|
||||
* @see \Codeception\Module\Laravel5::seeFormHasErrors()
|
||||
*/
|
||||
public function canSeeSessionErrorMessage($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeSessionErrorMessage', func_get_args()));
|
||||
public function canSeeFormHasErrors() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFormHasErrors', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that Session has error messages
|
||||
* The seeSessionHasValues cannot be used, as Message bag Object is returned by Laravel4
|
||||
* Assert that the form errors are bound to the View.
|
||||
*
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeSessionErrorMessage(array('username'=>'Invalid Username'));
|
||||
* ?>
|
||||
* ```
|
||||
* @param array $bindings
|
||||
* @see \Codeception\Module\Laravel4::seeSessionErrorMessage()
|
||||
* @return bool
|
||||
* @see \Codeception\Module\Laravel5::seeFormHasErrors()
|
||||
*/
|
||||
public function seeSessionErrorMessage($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeSessionErrorMessage', func_get_args()));
|
||||
public function seeFormHasErrors() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFormHasErrors', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that the session has errors bound.
|
||||
* Assert that specific form error messages are set in the view.
|
||||
*
|
||||
* @return bool
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFormErrorMessages(array('username'=>'Invalid Username'));
|
||||
* ?>
|
||||
* ```
|
||||
* @param array $bindings
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeSessionHasErrors()
|
||||
* @see \Codeception\Module\Laravel5::seeFormErrorMessages()
|
||||
*/
|
||||
public function canSeeSessionHasErrors() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeSessionHasErrors', func_get_args()));
|
||||
public function canSeeFormErrorMessages($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFormErrorMessages', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that the session has errors bound.
|
||||
* Assert that specific form error messages are set in the view.
|
||||
*
|
||||
* @return bool
|
||||
* @see \Codeception\Module\Laravel4::seeSessionHasErrors()
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFormErrorMessages(array('username'=>'Invalid Username'));
|
||||
* ?>
|
||||
* ```
|
||||
* @param array $bindings
|
||||
* @see \Codeception\Module\Laravel5::seeFormErrorMessages()
|
||||
*/
|
||||
public function seeSessionHasErrors() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeSessionHasErrors', func_get_args()));
|
||||
public function seeFormErrorMessages($bindings) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFormErrorMessages', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that specific form error message is set in the view.
|
||||
*
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFormErrorMessage('username', 'Invalid Username');
|
||||
* ?>
|
||||
* ```
|
||||
* @param string $key
|
||||
* @param string $errorMessage
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel5::seeFormErrorMessage()
|
||||
*/
|
||||
public function canSeeFormErrorMessage($key, $errorMessage) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFormErrorMessage', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Assert that specific form error message is set in the view.
|
||||
*
|
||||
* Useful for validation messages and generally messages array
|
||||
* e.g.
|
||||
* return `Redirect::to('register')->withErrors($validator);`
|
||||
*
|
||||
* Example of Usage
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
* $I->seeFormErrorMessage('username', 'Invalid Username');
|
||||
* ?>
|
||||
* ```
|
||||
* @param string $key
|
||||
* @param string $errorMessage
|
||||
* @see \Codeception\Module\Laravel5::seeFormErrorMessage()
|
||||
*/
|
||||
public function seeFormErrorMessage($key, $errorMessage) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFormErrorMessage', func_get_args()));
|
||||
}
|
||||
|
||||
|
||||
@@ -299,12 +337,13 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Set the currently logged in user for the application.
|
||||
* Takes either `UserInterface` instance or array of credentials.
|
||||
* Takes either an object that implements the User interface or
|
||||
* an array of credentials.
|
||||
*
|
||||
* @param \Illuminate\Auth\UserInterface|array $user
|
||||
* @param \Illuminate\Contracts\Auth\User|array $user
|
||||
* @param string $driver
|
||||
* @return void
|
||||
* @see \Codeception\Module\Laravel4::amLoggedAs()
|
||||
* @see \Codeception\Module\Laravel5::amLoggedAs()
|
||||
*/
|
||||
public function amLoggedAs($user, $driver = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Condition('amLoggedAs', func_get_args()));
|
||||
@@ -315,7 +354,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Logs user out
|
||||
* @see \Codeception\Module\Laravel4::logout()
|
||||
* @see \Codeception\Module\Laravel5::logout()
|
||||
*/
|
||||
public function logout() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('logout', func_get_args()));
|
||||
@@ -327,7 +366,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* Checks that user is authenticated
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeAuthentication()
|
||||
* @see \Codeception\Module\Laravel5::seeAuthentication()
|
||||
*/
|
||||
public function canSeeAuthentication() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeAuthentication', func_get_args()));
|
||||
@@ -336,7 +375,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that user is authenticated
|
||||
* @see \Codeception\Module\Laravel4::seeAuthentication()
|
||||
* @see \Codeception\Module\Laravel5::seeAuthentication()
|
||||
*/
|
||||
public function seeAuthentication() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeAuthentication', func_get_args()));
|
||||
@@ -348,7 +387,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* Check that user is not authenticated
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::dontSeeAuthentication()
|
||||
* @see \Codeception\Module\Laravel5::dontSeeAuthentication()
|
||||
*/
|
||||
public function cantSeeAuthentication() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeAuthentication', func_get_args()));
|
||||
@@ -357,7 +396,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Check that user is not authenticated
|
||||
* @see \Codeception\Module\Laravel4::dontSeeAuthentication()
|
||||
* @see \Codeception\Module\Laravel5::dontSeeAuthentication()
|
||||
*/
|
||||
public function dontSeeAuthentication() {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeAuthentication', func_get_args()));
|
||||
@@ -388,7 +427,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param string $class
|
||||
* @return mixed
|
||||
* @see \Codeception\Module\Laravel4::grabService()
|
||||
* @see \Codeception\Module\Laravel5::grabService()
|
||||
*/
|
||||
public function grabService($class) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('grabService', func_get_args()));
|
||||
@@ -409,7 +448,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
* @see \Codeception\Module\Laravel4::haveRecord()
|
||||
* @see \Codeception\Module\Laravel5::haveRecord()
|
||||
*/
|
||||
public function haveRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('haveRecord', func_get_args()));
|
||||
@@ -428,7 +467,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::seeRecord()
|
||||
* @see \Codeception\Module\Laravel5::seeRecord()
|
||||
*/
|
||||
public function canSeeRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeRecord', func_get_args()));
|
||||
@@ -444,7 +483,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* @see \Codeception\Module\Laravel4::seeRecord()
|
||||
* @see \Codeception\Module\Laravel5::seeRecord()
|
||||
*/
|
||||
public function seeRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeRecord', func_get_args()));
|
||||
@@ -465,7 +504,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Module\Laravel4::dontSeeRecord()
|
||||
* @see \Codeception\Module\Laravel5::dontSeeRecord()
|
||||
*/
|
||||
public function cantSeeRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeRecord', func_get_args()));
|
||||
@@ -483,7 +522,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
*
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* @see \Codeception\Module\Laravel4::dontSeeRecord()
|
||||
* @see \Codeception\Module\Laravel5::dontSeeRecord()
|
||||
*/
|
||||
public function dontSeeRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeRecord', func_get_args()));
|
||||
@@ -504,7 +543,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* @param $model
|
||||
* @param array $attributes
|
||||
* @return mixed
|
||||
* @see \Codeception\Module\Laravel4::grabRecord()
|
||||
* @see \Codeception\Module\Laravel5::grabRecord()
|
||||
*/
|
||||
public function grabRecord($model, $attributes = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('grabRecord', func_get_args()));
|
||||
@@ -1518,6 +1557,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Sets a cookie with the given name and value.
|
||||
* You can set additional cookie params like `domain`, `path`, `expire`, `secure` in array passed as last argument.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
@@ -1525,13 +1565,16 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* ?>
|
||||
* ```
|
||||
*
|
||||
* @param $cookie
|
||||
* @param $value
|
||||
* @param $name
|
||||
* @param $val
|
||||
* @param array $params
|
||||
* @internal param $cookie
|
||||
* @internal param $value
|
||||
*
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::setCookie()
|
||||
*/
|
||||
public function setCookie($name, $val) {
|
||||
public function setCookie($name, $val, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -1540,13 +1583,15 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Grabs a cookie value.
|
||||
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::grabCookie()
|
||||
*/
|
||||
public function grabCookie($name) {
|
||||
public function grabCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -1555,6 +1600,7 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that a cookie with the given name is set.
|
||||
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
@@ -1563,18 +1609,19 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* ```
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCookie()
|
||||
*/
|
||||
public function canSeeCookie($name) {
|
||||
public function canSeeCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that a cookie with the given name is set.
|
||||
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
||||
*
|
||||
* ``` php
|
||||
* <?php
|
||||
@@ -1583,11 +1630,11 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* ```
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::seeCookie()
|
||||
*/
|
||||
public function seeCookie($name) {
|
||||
public function seeCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -1596,27 +1643,31 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that there isn't a cookie with the given name.
|
||||
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* Conditional Assertion: Test won't be stopped on fail
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
|
||||
*/
|
||||
public function cantSeeCookie($name) {
|
||||
public function cantSeeCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args()));
|
||||
}
|
||||
/**
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Checks that there isn't a cookie with the given name.
|
||||
* You can set additional cookie params like `domain`, `path` as array passed in last argument.
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
|
||||
*/
|
||||
public function dontSeeCookie($name) {
|
||||
public function dontSeeCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
|
||||
}
|
||||
|
||||
@@ -1625,13 +1676,15 @@ class IntegrationTester extends \Codeception\Actor
|
||||
* [!] Method is generated. Documentation taken from corresponding module.
|
||||
*
|
||||
* Unsets cookie with the given name.
|
||||
* You can set additional cookie params like `domain`, `path` in array passed as last argument.
|
||||
*
|
||||
* @param $cookie
|
||||
*
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @see \Codeception\Lib\InnerBrowser::resetCookie()
|
||||
*/
|
||||
public function resetCookie($name) {
|
||||
public function resetCookie($name, $params = null) {
|
||||
return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user