Enable auto renewing and updated Travis config

This commit is contained in:
Hillel Coren 2016-02-22 21:23:15 +02:00
parent 2af155cdee
commit 826d1b868b
10 changed files with 276 additions and 103 deletions

View File

@ -54,26 +54,26 @@ before_script:
- php artisan db:seed --no-interaction # default seed - php artisan db:seed --no-interaction # default seed
- php artisan db:seed --no-interaction --class=UserTableSeeder # development seed - php artisan db:seed --no-interaction --class=UserTableSeeder # development seed
# Start webserver on ninja.dev:8000 # Start webserver on ninja.dev:8000
- php artisan serve --host=ninja.dev --port=8000 & # '&' allows to run in background - php artisan serve --host=ninja.dev & # '&' allows to run in background
# Start PhantomJS # Start PhantomJS
- phantomjs --webdriver=4444 & # '&' allows to run in background - phantomjs --webdriver=4444 & # '&' allows to run in background
# Give it some time to start # Give it some time to start
- sleep 5 - sleep 5
# Make sure the app is up-to-date # Make sure the app is up-to-date
- curl -L http://ninja.dev:8000/update - curl -L http://ninja.dev/update
script: script:
- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php
- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php #- php ./vendor/codeception/codeception/codecept run acceptance OnlinePaymentCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php
- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php
#- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env
#- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php

View File

@ -47,7 +47,7 @@ class SendRenewalInvoices extends Command
} }
$client = $this->accountRepo->getNinjaClient($account); $client = $this->accountRepo->getNinjaClient($account);
$invitation = $this->accountRepo->createNinjaInvoice($client); $invitation = $this->accountRepo->createNinjaInvoice($client, $account);
// set the due date to 10 days from now // set the due date to 10 days from now
$invoice = $invitation->invoice; $invoice = $invitation->invoice;

View File

@ -16,6 +16,7 @@ class Kernel extends ConsoleKernel
'App\Console\Commands\ResetData', 'App\Console\Commands\ResetData',
'App\Console\Commands\CheckData', 'App\Console\Commands\CheckData',
'App\Console\Commands\SendRenewalInvoices', 'App\Console\Commands\SendRenewalInvoices',
'App\Console\Commands\ChargeRenewalInvoices',
'App\Console\Commands\SendReminders', 'App\Console\Commands\SendReminders',
'App\Console\Commands\TestOFX', 'App\Console\Commands\TestOFX',
'App\Console\Commands\GenerateResources', 'App\Console\Commands\GenerateResources',

View File

@ -72,7 +72,7 @@ class Utils
public static function requireHTTPS() public static function requireHTTPS()
{ {
if (Request::root() === 'http://ninja.dev:8000') { if (Request::root() === 'http://ninja.dev') {
return false; return false;
} }

View File

@ -24,29 +24,49 @@ class SubscriptionListener
{ {
public function createdClient(ClientWasCreated $event) public function createdClient(ClientWasCreated $event)
{ {
if ( ! Auth::check()) {
return;
}
$transformer = new ClientTransformer(Auth::user()->account); $transformer = new ClientTransformer(Auth::user()->account);
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer);
} }
public function createdQuote(QuoteWasCreated $event) public function createdQuote(QuoteWasCreated $event)
{ {
if ( ! Auth::check()) {
return;
}
$transformer = new InvoiceTransformer(Auth::user()->account); $transformer = new InvoiceTransformer(Auth::user()->account);
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
} }
public function createdPayment(PaymentWasCreated $event) public function createdPayment(PaymentWasCreated $event)
{ {
if ( ! Auth::check()) {
return;
}
$transformer = new PaymentTransformer(Auth::user()->account); $transformer = new PaymentTransformer(Auth::user()->account);
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]);
} }
public function createdCredit(CreditWasCreated $event) public function createdCredit(CreditWasCreated $event)
{ {
if ( ! Auth::check()) {
return;
}
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit); //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit);
} }
public function createdInvoice(InvoiceWasCreated $event) public function createdInvoice(InvoiceWasCreated $event)
{ {
if ( ! Auth::check()) {
return;
}
$transformer = new InvoiceTransformer(Auth::user()->account); $transformer = new InvoiceTransformer(Auth::user()->account);
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT);
} }

View File

@ -124,13 +124,14 @@ class AccountRepository
return false; return false;
} }
$client = $this->getNinjaClient(Auth::user()->account); $account = Auth::user()->account;
$invitation = $this->createNinjaInvoice($client); $client = $this->getNinjaClient($account);
$invitation = $this->createNinjaInvoice($client, $account);
return $invitation; return $invitation;
} }
public function createNinjaInvoice($client) public function createNinjaInvoice($client, $account)
{ {
$account = $this->getNinjaAccount(); $account = $this->getNinjaAccount();
$lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first(); $lastInvoice = Invoice::withTrashed()->whereAccountId($account->id)->orderBy('public_id', 'DESC')->first();
@ -142,7 +143,7 @@ class AccountRepository
$invoice->public_id = $publicId; $invoice->public_id = $publicId;
$invoice->client_id = $client->id; $invoice->client_id = $client->id;
$invoice->invoice_number = $account->getNextInvoiceNumber($invoice); $invoice->invoice_number = $account->getNextInvoiceNumber($invoice);
$invoice->invoice_date = Auth::user()->account->getRenewalDate(); $invoice->invoice_date = $account->getRenewalDate();
$invoice->amount = PRO_PLAN_PRICE; $invoice->amount = PRO_PLAN_PRICE;
$invoice->balance = PRO_PLAN_PRICE; $invoice->balance = PRO_PLAN_PRICE;
$invoice->save(); $invoice->save();

View File

@ -2,7 +2,7 @@
// This is global bootstrap for autoloading // This is global bootstrap for autoloading
use Codeception\Util\Fixtures; use Codeception\Util\Fixtures;
Fixtures::add('url', 'http://ninja.dev:8000'); Fixtures::add('url', 'http://ninja.dev');
Fixtures::add('username', 'user@example.com'); Fixtures::add('username', 'user@example.com');
Fixtures::add('password', 'password'); Fixtures::add('password', 'password');

View File

@ -1,4 +1,4 @@
<?php //[STAMP] fd572cb1f679911978b9f48a842ed64b <?php //[STAMP] 5d3610ae822b6990504d5dce501c103b
namespace _generated; namespace _generated;
// This class was automatically generated by build task // This class was automatically generated by build task
@ -17,6 +17,17 @@ trait AcceptanceTesterActions
abstract protected function getScenario(); abstract protected function getScenario();
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Print out latest Selenium Logs in debug mode
* @see \Codeception\Module\WebDriver::debugWebDriverLogs()
*/
public function debugWebDriverLogs() {
return $this->getScenario()->runStep(new \Codeception\Step\Action('debugWebDriverLogs', func_get_args()));
}
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
@ -166,7 +177,7 @@ trait AcceptanceTesterActions
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Sets a cookie with the given name and value. * 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. * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument.
* *
* ``` php * ``` php
* <?php * <?php
@ -249,7 +260,6 @@ trait AcceptanceTesterActions
* $I->amOnPage('/'); * $I->amOnPage('/');
* // opens /register page * // opens /register page
* $I->amOnPage('/register'); * $I->amOnPage('/register');
* ?>
* ``` * ```
* *
* @param $page * @param $page
@ -263,17 +273,32 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks that the current page contains the given string. * Checks that the current page contains the given string (case insensitive).
* Specify a locator as the second parameter to match a specific region. *
* You can specify a specific HTML element (via CSS or XPath) as the second
* parameter to only search within that element.
* *
* ``` php * ``` php
* <?php * <?php
* $I->see('Logout'); // I can suppose user is logged in * $I->see('Logout'); // I can suppose user is logged in
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
* $I->see('Sign Up', '//body/h1'); // with XPath * $I->see('Sign Up', '//body/h1'); // with XPath
* ?>
* ``` * ```
* *
* Note that the search is done after stripping all HTML tags from the body,
* so `$I->see('strong')` will return true for strings like:
*
* - `<p>I am Stronger than thou</p>`
* - `<script>document.createElement('strong');</script>`
*
* But will *not* be true for strings like:
*
* - `<strong>Home</strong>`
* - `<div class="strong">Home</strong>`
* - `<!-- strong -->`
*
* For checking the raw source code, use `seeInSource()`.
*
* @param $text * @param $text
* @param null $selector * @param null $selector
* Conditional Assertion: Test won't be stopped on fail * Conditional Assertion: Test won't be stopped on fail
@ -285,17 +310,32 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks that the current page contains the given string. * Checks that the current page contains the given string (case insensitive).
* Specify a locator as the second parameter to match a specific region. *
* You can specify a specific HTML element (via CSS or XPath) as the second
* parameter to only search within that element.
* *
* ``` php * ``` php
* <?php * <?php
* $I->see('Logout'); // I can suppose user is logged in * $I->see('Logout'); // I can suppose user is logged in
* $I->see('Sign Up', 'h1'); // I can suppose it's a signup page * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page
* $I->see('Sign Up', '//body/h1'); // with XPath * $I->see('Sign Up', '//body/h1'); // with XPath
* ?>
* ``` * ```
* *
* Note that the search is done after stripping all HTML tags from the body,
* so `$I->see('strong')` will return true for strings like:
*
* - `<p>I am Stronger than thou</p>`
* - `<script>document.createElement('strong');</script>`
*
* But will *not* be true for strings like:
*
* - `<strong>Home</strong>`
* - `<div class="strong">Home</strong>`
* - `<!-- strong -->`
*
* For checking the raw source code, use `seeInSource()`.
*
* @param $text * @param $text
* @param null $selector * @param null $selector
* @see \Codeception\Module\WebDriver::see() * @see \Codeception\Module\WebDriver::see()
@ -308,7 +348,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks that the current page doesn't contain the text specified. * Checks that the current page doesn't contain the text specified (case insensitive).
* Give a locator as the second parameter to match a specific region. * Give a locator as the second parameter to match a specific region.
* *
* ```php * ```php
@ -316,9 +356,22 @@ trait AcceptanceTesterActions
* $I->dontSee('Login'); // I can suppose user is already logged in * $I->dontSee('Login'); // I can suppose user is already logged in
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
* $I->dontSee('Sign Up','//body/h1'); // with XPath * $I->dontSee('Sign Up','//body/h1'); // with XPath
* ?>
* ``` * ```
* *
* Note that the search is done after stripping all HTML tags from the body,
* so `$I->dontSee('strong')` will fail on strings like:
*
* - `<p>I am Stronger than thou</p>`
* - `<script>document.createElement('strong');</script>`
*
* But will ignore strings like:
*
* - `<strong>Home</strong>`
* - `<div class="strong">Home</strong>`
* - `<!-- strong -->`
*
* For checking the raw source code, use `seeInSource()`.
*
* @param $text * @param $text
* @param null $selector * @param null $selector
* Conditional Assertion: Test won't be stopped on fail * Conditional Assertion: Test won't be stopped on fail
@ -330,7 +383,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks that the current page doesn't contain the text specified. * Checks that the current page doesn't contain the text specified (case insensitive).
* Give a locator as the second parameter to match a specific region. * Give a locator as the second parameter to match a specific region.
* *
* ```php * ```php
@ -338,9 +391,22 @@ trait AcceptanceTesterActions
* $I->dontSee('Login'); // I can suppose user is already logged in * $I->dontSee('Login'); // I can suppose user is already logged in
* $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page
* $I->dontSee('Sign Up','//body/h1'); // with XPath * $I->dontSee('Sign Up','//body/h1'); // with XPath
* ?>
* ``` * ```
* *
* Note that the search is done after stripping all HTML tags from the body,
* so `$I->dontSee('strong')` will fail on strings like:
*
* - `<p>I am Stronger than thou</p>`
* - `<script>document.createElement('strong');</script>`
*
* But will ignore strings like:
*
* - `<strong>Home</strong>`
* - `<div class="strong">Home</strong>`
* - `<!-- strong -->`
*
* For checking the raw source code, use `seeInSource()`.
*
* @param $text * @param $text
* @param null $selector * @param null $selector
* @see \Codeception\Module\WebDriver::dontSee() * @see \Codeception\Module\WebDriver::dontSee()
@ -350,6 +416,80 @@ trait AcceptanceTesterActions
} }
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that the current page contains the given string in its
* raw source code.
*
* ``` php
* <?php
* $I->seeInSource('<h1>Green eggs &amp; ham</h1>');
* ```
*
* @param $raw
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\WebDriver::seeInSource()
*/
public function canSeeInSource($raw) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that the current page contains the given string in its
* raw source code.
*
* ``` php
* <?php
* $I->seeInSource('<h1>Green eggs &amp; ham</h1>');
* ```
*
* @param $raw
* @see \Codeception\Module\WebDriver::seeInSource()
*/
public function seeInSource($raw) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that the current page contains the given string in its
* raw source code.
*
* ```php
* <?php
* $I->dontSeeInSource('<h1>Green eggs &amp; ham</h1>');
* ```
*
* @param $raw
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\WebDriver::dontSeeInSource()
*/
public function cantSeeInSource($raw) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks that the current page contains the given string in its
* raw source code.
*
* ```php
* <?php
* $I->dontSeeInSource('<h1>Green eggs &amp; ham</h1>');
* ```
*
* @param $raw
* @see \Codeception\Module\WebDriver::dontSeeInSource()
*/
public function dontSeeInSource($raw) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args()));
}
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
@ -790,7 +930,6 @@ trait AcceptanceTesterActions
* *
* @param null $uri * @param null $uri
* *
* @internal param $url
* @return mixed * @return mixed
* @see \Codeception\Module\WebDriver::grabFromCurrentUrl() * @see \Codeception\Module\WebDriver::grabFromCurrentUrl()
*/ */
@ -1388,7 +1527,7 @@ trait AcceptanceTesterActions
* *
* @param $cssOrXpath * @param $cssOrXpath
* @param $attribute * @param $attribute
* @internal param $element *
* @return mixed * @return mixed
* @see \Codeception\Module\WebDriver::grabAttributeFrom() * @see \Codeception\Module\WebDriver::grabAttributeFrom()
*/ */
@ -1425,7 +1564,28 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Grabs either the text content, or attribute values, of nodes
* matched by $cssOrXpath and returns them as an array.
* *
* ```html
* <a href="#first">First</a>
* <a href="#second">Second</a>
* <a href="#third">Third</a>
* ```
*
* ```php
* <?php
* // would return ['First', 'Second', 'Third']
* $aLinkText = $I->grabMultiple('a');
*
* // would return ['#first', '#second', '#third']
* $aLinks = $I->grabMultiple('a', 'href');
* ?>
* ```
*
* @param $cssOrXpath
* @param $attribute
* @return string[]
* @see \Codeception\Module\WebDriver::grabMultiple() * @see \Codeception\Module\WebDriver::grabMultiple()
*/ */
public function grabMultiple($cssOrXpath, $attribute = null) { public function grabMultiple($cssOrXpath, $attribute = null) {
@ -1640,6 +1800,27 @@ trait AcceptanceTesterActions
} }
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
*/
public function canSeeNumberOfElementsInDOM($selector, $expected) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElementsInDOM', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\WebDriver::seeNumberOfElementsInDOM()
*/
public function seeNumberOfElementsInDOM($selector, $expected) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElementsInDOM', func_get_args()));
}
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
@ -2179,7 +2360,7 @@ trait AcceptanceTesterActions
* If Codeception commands are not enough, this allows you to use Selenium WebDriver methods directly: * If Codeception commands are not enough, this allows you to use Selenium WebDriver methods directly:
* *
* ``` php * ``` php
* $I->executeInSelenium(function(\Facebook\WebDriver\RemoteWebDriver $webdriver) { * $I->executeInSelenium(function(\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
* $webdriver->get('http://google.com'); * $webdriver->get('http://google.com');
* }); * });
* ``` * ```
@ -2222,7 +2403,7 @@ trait AcceptanceTesterActions
* *
* ``` php * ``` php
* <?php * <?php
* $I->executeInSelenium(function (\Facebook\WebDriver\RemoteWebDriver $webdriver) { * $I->executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) {
* $handles=$webdriver->getWindowHandles(); * $handles=$webdriver->getWindowHandles();
* $last_window = end($handles); * $last_window = end($handles);
* $webdriver->switchTo()->window($last_window); * $webdriver->switchTo()->window($last_window);
@ -2463,34 +2644,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Saves current cookies into named snapshot in order to restore them in other tests * @param string $name
* This is useful to save session state between tests.
* For example, if user needs log in to site for each test this scenario can be executed once
* while other tests can just restore saved cookies.
*
* ``` php
* <?php
* // inside AcceptanceTester class:
*
* public function login()
* {
* // if snapshot exists - skipping login
* if ($I->loadSessionSnapshot('login')) return;
*
* // logging in
* $I->amOnPage('/login');
* $I->fillField('name', 'jon');
* $I->fillField('password', '123345');
* $I->click('Login');
*
* // saving snapshot
* $I->saveSessionSnapshot('login');
* }
* ?>
* ```
*
* @param $name
* @return mixed
* @see \Codeception\Module\WebDriver::saveSessionSnapshot() * @see \Codeception\Module\WebDriver::saveSessionSnapshot()
*/ */
public function saveSessionSnapshot($name) { public function saveSessionSnapshot($name) {
@ -2501,11 +2655,8 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Loads cookies from saved snapshot. * @param string $name
* * @return bool
* @param $name
* @see saveSessionSnapshot
* @return mixed
* @see \Codeception\Module\WebDriver::loadSessionSnapshot() * @see \Codeception\Module\WebDriver::loadSessionSnapshot()
*/ */
public function loadSessionSnapshot($name) { public function loadSessionSnapshot($name) {
@ -2516,7 +2667,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Inserts SQL record into database. This record will be erased after the test. * Inserts an SQL record into a database. This record will be erased after the test.
* *
* ``` php * ``` php
* <?php * <?php
@ -2538,7 +2689,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks if a row with given column values exists. * Asserts that a row with the given column values exists.
* Provide table name and column values. * Provide table name and column values.
* *
* Example: * Example:
@ -2566,7 +2717,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Checks if a row with given column values exists. * Asserts that a row with the given column values exists.
* Provide table name and column values. * Provide table name and column values.
* *
* Example: * Example:
@ -2595,7 +2746,7 @@ trait AcceptanceTesterActions
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Asserts that found number of records in database * Asserts that the given number of records were found in the database.
* *
* ``` php * ``` php
* <?php * <?php
@ -2603,19 +2754,19 @@ trait AcceptanceTesterActions
* ?> * ?>
* ``` * ```
* *
* @param int $num Expected number * @param int $expectedNumber Expected number
* @param string $table Table name * @param string $table Table name
* @param array $criteria Search criteria [Optional] * @param array $criteria Search criteria [Optional]
* Conditional Assertion: Test won't be stopped on fail * Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Db::seeNumRecords() * @see \Codeception\Module\Db::seeNumRecords()
*/ */
public function canSeeNumRecords($num, $table, $criteria = null) { public function canSeeNumRecords($expectedNumber, $table, $criteria = null) {
return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumRecords', func_get_args())); return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumRecords', func_get_args()));
} }
/** /**
* [!] Method is generated. Documentation taken from corresponding module. * [!] Method is generated. Documentation taken from corresponding module.
* *
* Asserts that found number of records in database * Asserts that the given number of records were found in the database.
* *
* ``` php * ``` php
* <?php * <?php
@ -2623,12 +2774,12 @@ trait AcceptanceTesterActions
* ?> * ?>
* ``` * ```
* *
* @param int $num Expected number * @param int $expectedNumber Expected number
* @param string $table Table name * @param string $table Table name
* @param array $criteria Search criteria [Optional] * @param array $criteria Search criteria [Optional]
* @see \Codeception\Module\Db::seeNumRecords() * @see \Codeception\Module\Db::seeNumRecords()
*/ */
public function seeNumRecords($num, $table, $criteria = null) { public function seeNumRecords($expectedNumber, $table, $criteria = null) {
return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumRecords', func_get_args())); return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumRecords', func_get_args()));
} }
@ -2638,7 +2789,7 @@ trait AcceptanceTesterActions
* *
* Effect is opposite to ->seeInDatabase * Effect is opposite to ->seeInDatabase
* *
* Checks if there is no record with such column values in database. * Asserts that there is no record with the given column values in a database.
* Provide table name and column values. * Provide table name and column values.
* *
* Example: * Example:
@ -2668,7 +2819,7 @@ trait AcceptanceTesterActions
* *
* Effect is opposite to ->seeInDatabase * Effect is opposite to ->seeInDatabase
* *
* Checks if there is no record with such column values in database. * Asserts that there is no record with the given column values in a database.
* Provide table name and column values. * Provide table name and column values.
* *
* Example: * Example:

View File

@ -8,7 +8,7 @@ class_name: AcceptanceTester
modules: modules:
enabled: enabled:
- WebDriver: - WebDriver:
url: 'http://ninja.dev:8000/' url: 'http://ninja.dev/'
window_size: 1024x768 window_size: 1024x768
wait: 5 wait: 5
browser: firefox browser: firefox

View File

@ -9,7 +9,7 @@ modules:
enabled: enabled:
- \Helper\Functional - \Helper\Functional
- PhpBrowser: - PhpBrowser:
url: 'http://ninja.dev:8000' url: 'http://ninja.dev'
curl: curl:
CURLOPT_RETURNTRANSFER: true CURLOPT_RETURNTRANSFER: true
- Laravel5: - Laravel5: