- {debugPrint($oTrashVO->unserializedObject)}
| {$lang->document}{$lang->comment} |
{$lang->no_text_comment}
diff --git a/tests/Install.suite.dist.yml b/tests/Install.suite.dist.yml
new file mode 100644
index 000000000..b217a1c35
--- /dev/null
+++ b/tests/Install.suite.dist.yml
@@ -0,0 +1,28 @@
+class_name: InstallTester
+modules:
+ enabled: [Db, PhpBrowser, DbDropTablesHelper, InstallHelper, Filesystem]
+ config:
+ PhpBrowser:
+ url: 'http://localhost:8000/'
+ DbDropTablesHelper:
+ dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
+ user: 'root'
+ password: 'root'
+ Db:
+ dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
+ user: 'root'
+ password: 'root'
+ cleanup: true
+env:
+ travis:
+ modules:
+ config:
+ Db:
+ dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
+ user: 'travis'
+ password: 'travis'
+ cleanup: true
+ DbDropTablesHelper:
+ dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
+ user: 'travis'
+ password: 'travis'
diff --git a/tests/Install/AutoinstallCept.php b/tests/Install/AutoinstallCept.php
new file mode 100644
index 000000000..91b244ff2
--- /dev/null
+++ b/tests/Install/AutoinstallCept.php
@@ -0,0 +1,63 @@
+env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
+
+$db_config = $config['modules']['config']['Db'];
+
+$dsn = $db_config['dsn'];
+$dsn = split('[;:]', $dsn);
+$db_type = array_shift($dsn);
+$dbinfo = [
+ 'type' => $db_type,
+ 'user' => $db_config['user'],
+ 'password' => $db_config['password'],
+ 'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
+];
+foreach($dsn as $piece) {
+ list($key, $val) = explode('=', $piece);
+ $dbinfo[$key] = $val;
+}
+
+$install_config = array(
+ 'db_type' => $dbinfo['type'],
+ 'db_port' => $dbinfo['port'],
+ 'db_hostname' => $dbinfo['host'],
+ 'db_userid' => $dbinfo['user'],
+ 'db_password' => $dbinfo['password'],
+ 'db_database' => $dbinfo['dbname'],
+ 'db_table_prefix' =>'xe_',
+ 'use_rewrite' =>'N',
+ 'time_zone' =>'0900',
+ 'email_address' =>'admin@admin.net',
+ 'password' =>'admin',
+ 'password2' =>'admin',
+ 'nick_name' =>'admin',
+ 'user_id' =>'admin',
+ 'lang_type' => 'ko',
+);
+
+$install_config = '<' . '?php $install_config = ' . var_export($install_config, true) . ';';
+
+$I->wantTo('Auto install');
+$I->writeToFile(_XE_PATH_ . 'config/install.config.php', $install_config);
+$I->amOnPage('/');
+
+$I->dontSeeElement('//div[@id="progress"]/ul/li');
+$I->amOnPage('/index.php?act=dispMemberLoginForm');
+
+$I->fillField('user_id', 'admin@admin.net');
+$I->submitForm('.login-body form', [
+ 'act' => 'procMemberLogin',
+ 'user_id' => 'admin@admin.net',
+ 'password' => 'admin',
+ 'success_return_url' => '/index.php?module=admin'
+]);
+
+$I->seeInCurrentUrl('module=admin');
+$I->seeElement('#gnbNav');
+$I->seeElement('#content .x_page-header');
+$I->see('설치 환경 수집 동의', 'h2');
+
diff --git a/tests/install/installCept.php b/tests/Install/InstallCept.php
similarity index 92%
rename from tests/install/installCept.php
rename to tests/Install/InstallCept.php
index d5c0bf171..a3e5750b7 100644
--- a/tests/install/installCept.php
+++ b/tests/Install/InstallCept.php
@@ -3,13 +3,13 @@ use \Codeception\Configuration;
$I = new InstallTester($scenario);
-$config = (!$this->env) ? Configuration::config() : Configuration::suiteEnvironments('install')[$this->env];
+$config = (!$this->env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
+
$db_config = $config['modules']['config']['Db'];
$dsn = $db_config['dsn'];
$dsn = split('[;:]', $dsn);
$db_type = array_shift($dsn);
-
$dbinfo = [
'type' => $db_type,
'user' => $db_config['user'],
@@ -17,12 +17,15 @@ $dbinfo = [
'dbname' => 'xe_install',
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
];
-
foreach($dsn as $piece) {
list($key, $val) = explode('=', $piece);
$dbinfo[$key] = $val;
}
+if(\Filehandler::exists(_XE_PATH_ . 'config/install.config.php')) {
+ $I->deleteFile(_XE_PATH_ . 'config/install.config.php');
+}
+
// Step 1
$I->wantTo('Install XE Core');
$I->amOnPage('/index.php?l=ko');
@@ -86,7 +89,6 @@ $I->submitForm('#content form', [
]);
// Step 9
-$I->wantTo('completed');
$I->dontSeeElement('//div[@id="progress"]/ul/li');
$I->amOnPage('/index.php?act=dispMemberLoginForm');
diff --git a/tests/install/InstallTester.php b/tests/Install/InstallTester.php
similarity index 80%
rename from tests/install/InstallTester.php
rename to tests/Install/InstallTester.php
index fe24ccae1..1e1aef6fa 100644
--- a/tests/install/InstallTester.php
+++ b/tests/Install/InstallTester.php
@@ -1,12 +1,15 @@
-haveInDatabase('users', array('name' => 'miles', 'email' => 'miles@davis.com'));
+ * ?>
+ * ```
+ *
+ * @param $table
+ * @param array $data
+ *
+ * @return integer $id
+ * @see \Codeception\Module\Db::haveInDatabase()
+ */
+ public function haveInDatabase($table, $data) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('haveInDatabase', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if a row with given column values exists.
+ * Provide table name and column values.
+ *
+ * Example:
+ *
+ * ``` php
+ * seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
+ *
+ * ```
+ * Will generate:
+ *
+ * ``` sql
+ * SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
+ * ```
+ * Fails if no such user found.
+ *
+ * @param $table
+ * @param array $criteria
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Db::seeInDatabase()
+ */
+ public function canSeeInDatabase($table, $criteria = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInDatabase', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if a row with given column values exists.
+ * Provide table name and column values.
+ *
+ * Example:
+ *
+ * ``` php
+ * seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
+ *
+ * ```
+ * Will generate:
+ *
+ * ``` sql
+ * SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
+ * ```
+ * Fails if no such user found.
+ *
+ * @param $table
+ * @param array $criteria
+ * @see \Codeception\Module\Db::seeInDatabase()
+ */
+ public function seeInDatabase($table, $criteria = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInDatabase', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Effect is opposite to ->seeInDatabase
+ *
+ * Checks if there is no record with such column values in database.
+ * Provide table name and column values.
+ *
+ * Example:
+ *
+ * ``` php
+ * dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
+ *
+ * ```
+ * Will generate:
+ *
+ * ``` sql
+ * SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
+ * ```
+ * Fails if such user was found.
+ *
+ * @param $table
+ * @param array $criteria
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Db::dontSeeInDatabase()
+ */
+ public function cantSeeInDatabase($table, $criteria = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInDatabase', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Effect is opposite to ->seeInDatabase
+ *
+ * Checks if there is no record with such column values in database.
+ * Provide table name and column values.
+ *
+ * Example:
+ *
+ * ``` php
+ * dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
+ *
+ * ```
+ * Will generate:
+ *
+ * ``` sql
+ * SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
+ * ```
+ * Fails if such user was found.
+ *
+ * @param $table
+ * @param array $criteria
+ * @see \Codeception\Module\Db::dontSeeInDatabase()
+ */
+ public function dontSeeInDatabase($table, $criteria = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInDatabase', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Fetches a single column value from a database.
+ * Provide table name, desired column and criteria.
+ *
+ * Example:
+ *
+ * ``` php
+ * grabFromDatabase('users', 'email', array('name' => 'Davert'));
+ *
+ * ```
+ *
+ * @version 1.1
+ *
+ * @param $table
+ * @param $column
+ * @param array $criteria
+ *
+ * @return mixed
+ * @see \Codeception\Module\Db::grabFromDatabase()
+ */
+ public function grabFromDatabase($table, $column, $criteria = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
+ }
+
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1915,4 +2086,348 @@ class InstallTester extends \Codeception\Actor
public function dontSeeInTitle($title) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
}
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ *
+ * @see \Codeception\Module\DbDropTablesHelper::cleanup()
+ */
+ public function cleanup() {
+ return $this->scenario->runStep(new \Codeception\Step\Action('cleanup', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Enters a directory In local filesystem.
+ * Project root directory is used by default
+ *
+ * @param $path
+ * @see \Codeception\Module\Filesystem::amInPath()
+ */
+ public function amInPath($path) {
+ return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Opens a file and stores it's content.
+ *
+ * Usage:
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @see \Codeception\Module\Filesystem::openFile()
+ */
+ public function openFile($filename) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Deletes a file
+ *
+ * ``` php
+ * deleteFile('composer.lock');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @see \Codeception\Module\Filesystem::deleteFile()
+ */
+ public function deleteFile($filename) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Deletes directory with all subdirectories
+ *
+ * ``` php
+ * deleteDir('vendor');
+ * ?>
+ * ```
+ *
+ * @param $dirname
+ * @see \Codeception\Module\Filesystem::deleteDir()
+ */
+ public function deleteDir($dirname) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Copies directory with all contents
+ *
+ * ``` php
+ * copyDir('vendor','old_vendor');
+ * ?>
+ * ```
+ *
+ * @param $src
+ * @param $dst
+ * @see \Codeception\Module\Filesystem::copyDir()
+ */
+ public function copyDir($src, $dst) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks If opened file has `text` in it.
+ *
+ * Usage:
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Filesystem::seeInThisFile()
+ */
+ public function canSeeInThisFile($text) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks If opened file has `text` in it.
+ *
+ * Usage:
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @see \Codeception\Module\Filesystem::seeInThisFile()
+ */
+ public function seeInThisFile($text) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks the strict matching of file contents.
+ * Unlike `seeInThisFile` will fail if file has something more than expected lines.
+ * Better to use with HEREDOC strings.
+ * Matching is done after removing "\r" chars from file content.
+ *
+ * ``` php
+ * openFile('process.pid');
+ * $I->seeFileContentsEqual('3192');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
+ */
+ public function canSeeFileContentsEqual($text) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks the strict matching of file contents.
+ * Unlike `seeInThisFile` will fail if file has something more than expected lines.
+ * Better to use with HEREDOC strings.
+ * Matching is done after removing "\r" chars from file content.
+ *
+ * ``` php
+ * openFile('process.pid');
+ * $I->seeFileContentsEqual('3192');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
+ */
+ public function seeFileContentsEqual($text) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks If opened file doesn't contain `text` in it
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->dontSeeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
+ */
+ public function cantSeeInThisFile($text) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks If opened file doesn't contain `text` in it
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->dontSeeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
+ */
+ public function dontSeeInThisFile($text) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Deletes a file
+ * @see \Codeception\Module\Filesystem::deleteThisFile()
+ */
+ public function deleteThisFile() {
+ return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if file exists in path.
+ * Opens a file when it's exists
+ *
+ * ``` php
+ * seeFileFound('UserModel.php','app/models');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @param string $path
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Filesystem::seeFileFound()
+ */
+ public function canSeeFileFound($filename, $path = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if file exists in path.
+ * Opens a file when it's exists
+ *
+ * ``` php
+ * seeFileFound('UserModel.php','app/models');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @param string $path
+ * @see \Codeception\Module\Filesystem::seeFileFound()
+ */
+ public function seeFileFound($filename, $path = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if file does not exists in path
+ *
+ * @param $filename
+ * @param string $path
+ * Conditional Assertion: Test won't be stopped on fail
+ * @see \Codeception\Module\Filesystem::dontSeeFileFound()
+ */
+ public function cantSeeFileFound($filename, $path = null) {
+ return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
+ }
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Checks if file does not exists in path
+ *
+ * @param $filename
+ * @param string $path
+ * @see \Codeception\Module\Filesystem::dontSeeFileFound()
+ */
+ public function dontSeeFileFound($filename, $path = null) {
+ return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Erases directory contents
+ *
+ * ``` php
+ * cleanDir('logs');
+ * ?>
+ * ```
+ *
+ * @param $dirname
+ * @see \Codeception\Module\Filesystem::cleanDir()
+ */
+ public function cleanDir($dirname) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
+ }
+
+
+ /**
+ * [!] Method is generated. Documentation taken from corresponding module.
+ *
+ * Saves contents to file
+ *
+ * @param $filename
+ * @param $contents
+ * @see \Codeception\Module\Filesystem::writeToFile()
+ */
+ public function writeToFile($filename, $contents) {
+ return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
+ }
}
diff --git a/tests/acceptance/_bootstrap.php b/tests/Install/_bootstrap.php
similarity index 100%
rename from tests/acceptance/_bootstrap.php
rename to tests/Install/_bootstrap.php
diff --git a/tests/_bootstrap.php b/tests/_bootstrap.php
index a778b4088..21bf1735c 100644
--- a/tests/_bootstrap.php
+++ b/tests/_bootstrap.php
@@ -2,7 +2,7 @@
// This is global bootstrap for autoloading
if(!defined('__XE__')) define('__XE__', true);
if(!defined('_XE_PATH_')) define('_XE_PATH_', realpath(dirname(__FILE__).'/../').'/');
-error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
+require_once _XE_PATH_.'config/config.inc.php';
function _debug() {
$args = func_get_args();
diff --git a/tests/_support/AcceptanceHelper.php b/tests/_support/AcceptanceHelper.php
deleted file mode 100644
index ed5f2393d..000000000
--- a/tests/_support/AcceptanceHelper.php
+++ /dev/null
@@ -1,10 +0,0 @@
-driver->getDbh();
+ if (!$dbh) {
+ throw new ModuleConfigException(
+ __CLASS__,
+ "No connection to database. Remove this module from config if you don't need database repopulation"
+ );
+ }
+
+ try {
+ $this->driver->cleanup();
+ } catch (\Exception $e) {
+ throw new ModuleException(__CLASS__, $e->getMessage());
+ }
+ }
+}
diff --git a/tests/_support/FunctionalHelper.php b/tests/_support/FunctionalHelper.php
deleted file mode 100644
index 00207a24b..000000000
--- a/tests/_support/FunctionalHelper.php
+++ /dev/null
@@ -1,10 +0,0 @@
-setHeader('X-Requested-With', 'Codeception');
- * $I->amOnPage('test-headers.php');
- * ?>
- * ```
- *
- * @param string $name the name of the request header
- * @param string $value the value to set it to for subsequent
- * requests
- * @see \Codeception\Module\PhpBrowser::setHeader()
- */
- public function setHeader($name, $value) {
- return $this->scenario->runStep(new \Codeception\Step\Action('setHeader', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Deletes the header with the passed name. Subsequent requests
- * will not have the deleted header in its request.
- *
- * Example:
- * ```php
- * setHeader('X-Requested-With', 'Codeception');
- * $I->amOnPage('test-headers.php');
- * // ...
- * $I->deleteHeader('X-Requested-With');
- * $I->amOnPage('some-other-page.php');
- * ?>
- * ```
- *
- * @param string $name the name of the header to delete.
- * @see \Codeception\Module\PhpBrowser::deleteHeader()
- */
- public function deleteHeader($name) {
- return $this->scenario->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Authenticates user for HTTP_AUTH
- *
- * @param $username
- * @param $password
- * @see \Codeception\Module\PhpBrowser::amHttpAuthenticated()
- */
- public function amHttpAuthenticated($username, $password) {
- return $this->scenario->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Opens the page for the given relative URI.
- *
- * ``` php
- * amOnPage('/');
- * // opens /register page
- * $I->amOnPage('/register');
- * ?>
- * ```
- *
- * @param $page
- * @see \Codeception\Module\PhpBrowser::amOnPage()
- */
- public function amOnPage($page) {
- return $this->scenario->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Open web page at the given absolute URL and sets its hostname as the base host.
- *
- * ``` php
- * amOnUrl('http://codeception.com');
- * $I->amOnPage('/quickstart'); // moves to http://codeception.com/quickstart
- * ?>
- * ```
- * @see \Codeception\Module\PhpBrowser::amOnUrl()
- */
- public function amOnUrl($url) {
- return $this->scenario->runStep(new \Codeception\Step\Condition('amOnUrl', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Changes the subdomain for the 'url' configuration parameter.
- * Does not open a page; use `amOnPage` for that.
- *
- * ``` php
- * amOnSubdomain('user');
- * $I->amOnPage('/');
- * // moves to http://user.mysite.com/
- * ?>
- * ```
- *
- * @param $subdomain
- *
- * @return mixed
- * @see \Codeception\Module\PhpBrowser::amOnSubdomain()
- */
- public function amOnSubdomain($subdomain) {
- return $this->scenario->runStep(new \Codeception\Step\Condition('amOnSubdomain', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Low-level API method.
- * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
- *
- * Example:
- *
- * ``` php
- * executeInGuzzle(function (\GuzzleHttp\Client $client) {
- * $client->get('/get', ['query' => ['foo' => 'bar']]);
- * });
- * ?>
- * ```
- *
- * It is not recommended to use this command on a regular basis.
- * If Codeception lacks important Guzzle Client methods, implement them and submit patches.
- *
- * @param callable $function
- * @see \Codeception\Module\PhpBrowser::executeInGuzzle()
- */
- public function executeInGuzzle($function) {
- return $this->scenario->runStep(new \Codeception\Step\Action('executeInGuzzle', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Perform a click on a link or a button, given by a locator.
- * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string.
- * For buttons, the "value" attribute, "name" attribute, and inner text are searched.
- * For links, the link text is searched.
- * For images, the "alt" attribute and inner text of any parent links are searched.
- *
- * The second parameter is a context (CSS or XPath locator) to narrow the search.
- *
- * Note that if the locator matches a button of type `submit`, the form will be submitted.
- *
- * ``` php
- * click('Logout');
- * // button of form
- * $I->click('Submit');
- * // CSS button
- * $I->click('#form input[type=submit]');
- * // XPath
- * $I->click('//form/*[@type=submit]');
- * // link in context
- * $I->click('Logout', '#nav');
- * // using strict locator
- * $I->click(['link' => 'Login']);
- * ?>
- * ```
- *
- * @param $link
- * @param $context
- * @see \Codeception\Lib\InnerBrowser::click()
- */
- public function click($link, $context = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('click', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current page contains the given string.
- * Specify a locator as the second parameter to match a specific region.
- *
- * ``` php
- * 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','//body/h1'); // with XPath
- * ?>
- * ```
- *
- * @param $text
- * @param null $selector
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::see()
- */
- public function canSee($text, $selector = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current page contains the given string.
- * Specify a locator as the second parameter to match a specific region.
- *
- * ``` php
- * 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','//body/h1'); // with XPath
- * ?>
- * ```
- *
- * @param $text
- * @param null $selector
- * @see \Codeception\Lib\InnerBrowser::see()
- */
- public function see($text, $selector = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('see', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current page doesn't contain the text specified.
- * Give a locator as the second parameter to match a specific region.
- *
- * ```php
- * 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','//body/h1'); // with XPath
- * ?>
- * ```
- *
- * @param $text
- * @param null $selector
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSee()
- */
- public function cantSee($text, $selector = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current page doesn't contain the text specified.
- * Give a locator as the second parameter to match a specific region.
- *
- * ```php
- * 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','//body/h1'); // with XPath
- * ?>
- * ```
- *
- * @param $text
- * @param null $selector
- * @see \Codeception\Lib\InnerBrowser::dontSee()
- */
- public function dontSee($text, $selector = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that there's a link with the specified text.
- * Give a full URL as the second parameter to match links with that exact URL.
- *
- * ``` php
- * seeLink('Logout'); // matches Logout
- * $I->seeLink('Logout','/logout'); // matches Logout
- * ?>
- * ```
- *
- * @param $text
- * @param null $url
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeLink()
- */
- public function canSeeLink($text, $url = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that there's a link with the specified text.
- * Give a full URL as the second parameter to match links with that exact URL.
- *
- * ``` php
- * seeLink('Logout'); // matches Logout
- * $I->seeLink('Logout','/logout'); // matches Logout
- * ?>
- * ```
- *
- * @param $text
- * @param null $url
- * @see \Codeception\Lib\InnerBrowser::seeLink()
- */
- public function seeLink($text, $url = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page doesn't contain a link with the given string.
- * If the second parameter is given, only links with a matching "href" attribute will be checked.
- *
- * ``` php
- * dontSeeLink('Logout'); // I suppose user is not logged in
- * $I->dontSeeLink('Checkout now', '/store/cart.php');
- * ?>
- * ```
- *
- * @param $text
- * @param null $url
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
- */
- public function cantSeeLink($text, $url = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page doesn't contain a link with the given string.
- * If the second parameter is given, only links with a matching "href" attribute will be checked.
- *
- * ``` php
- * dontSeeLink('Logout'); // I suppose user is not logged in
- * $I->dontSeeLink('Checkout now', '/store/cart.php');
- * ?>
- * ```
- *
- * @param $text
- * @param null $url
- * @see \Codeception\Lib\InnerBrowser::dontSeeLink()
- */
- public function dontSeeLink($text, $url = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that current URI contains the given string.
- *
- * ``` php
- * seeInCurrentUrl('home');
- * // to match: /users/1
- * $I->seeInCurrentUrl('/users/');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
- */
- public function canSeeInCurrentUrl($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that current URI contains the given string.
- *
- * ``` php
- * seeInCurrentUrl('home');
- * // to match: /users/1
- * $I->seeInCurrentUrl('/users/');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl()
- */
- public function seeInCurrentUrl($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URI doesn't contain the given string.
- *
- * ``` php
- * dontSeeInCurrentUrl('/users/');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
- */
- public function cantSeeInCurrentUrl($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URI doesn't contain the given string.
- *
- * ``` php
- * dontSeeInCurrentUrl('/users/');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl()
- */
- public function dontSeeInCurrentUrl($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL is equal to the given string.
- * Unlike `seeInCurrentUrl`, this only matches the full URL.
- *
- * ``` php
- * seeCurrentUrlEquals('/');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
- */
- public function canSeeCurrentUrlEquals($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL is equal to the given string.
- * Unlike `seeInCurrentUrl`, this only matches the full URL.
- *
- * ``` php
- * seeCurrentUrlEquals('/');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals()
- */
- public function seeCurrentUrlEquals($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL doesn't equal the given string.
- * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
- *
- * ``` php
- * dontSeeCurrentUrlEquals('/');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
- */
- public function cantSeeCurrentUrlEquals($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL doesn't equal the given string.
- * Unlike `dontSeeInCurrentUrl`, this only matches the full URL.
- *
- * ``` php
- * dontSeeCurrentUrlEquals('/');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals()
- */
- public function dontSeeCurrentUrlEquals($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL matches the given regular expression.
- *
- * ``` php
- * seeCurrentUrlMatches('~$/users/(\d+)~');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
- */
- public function canSeeCurrentUrlMatches($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the current URL matches the given regular expression.
- *
- * ``` php
- * seeCurrentUrlMatches('~$/users/(\d+)~');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches()
- */
- public function seeCurrentUrlMatches($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that current url doesn't match the given regular expression.
- *
- * ``` php
- * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
- * ?>
- * ```
- *
- * @param $uri
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
- */
- public function cantSeeCurrentUrlMatches($uri) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that current url doesn't match the given regular expression.
- *
- * ``` php
- * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
- * ?>
- * ```
- *
- * @param $uri
- * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches()
- */
- public function dontSeeCurrentUrlMatches($uri) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Executes the given regular expression against the current URI and returns the first match.
- * If no parameters are provided, the full URI is returned.
- *
- * ``` php
- * grabFromCurrentUrl('~$/user/(\d+)/~');
- * $uri = $I->grabFromCurrentUrl();
- * ?>
- * ```
- *
- * @param null $uri
- *
- * @internal param $url
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl()
- */
- public function grabFromCurrentUrl($uri = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the specified checkbox is checked.
- *
- * ``` php
- * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
- * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
- * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
- * ?>
- * ```
- *
- * @param $checkbox
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
- */
- public function canSeeCheckboxIsChecked($checkbox) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the specified checkbox is checked.
- *
- * ``` php
- * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms
- * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form.
- * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]');
- * ?>
- * ```
- *
- * @param $checkbox
- * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked()
- */
- public function seeCheckboxIsChecked($checkbox) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Check that the specified checkbox is unchecked.
- *
- * ``` php
- * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
- * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
- * ?>
- * ```
- *
- * @param $checkbox
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
- */
- public function cantSeeCheckboxIsChecked($checkbox) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Check that the specified checkbox is unchecked.
- *
- * ``` php
- * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms
- * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form.
- * ?>
- * ```
- *
- * @param $checkbox
- * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked()
- */
- public function dontSeeCheckboxIsChecked($checkbox) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given input field or textarea contains the given value.
- * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
- *
- * ``` php
- * seeInField('Body','Type your comment here');
- * $I->seeInField('form textarea[name=body]','Type your comment here');
- * $I->seeInField('form input[type=hidden]','hidden_value');
- * $I->seeInField('#searchform input','Search');
- * $I->seeInField('//form/*[@name=search]','Search');
- * $I->seeInField(['name' => 'search'], 'Search');
- * ?>
- * ```
- *
- * @param $field
- * @param $value
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeInField()
- */
- public function canSeeInField($field, $value) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given input field or textarea contains the given value.
- * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath.
- *
- * ``` php
- * seeInField('Body','Type your comment here');
- * $I->seeInField('form textarea[name=body]','Type your comment here');
- * $I->seeInField('form input[type=hidden]','hidden_value');
- * $I->seeInField('#searchform input','Search');
- * $I->seeInField('//form/*[@name=search]','Search');
- * $I->seeInField(['name' => 'search'], 'Search');
- * ?>
- * ```
- *
- * @param $field
- * @param $value
- * @see \Codeception\Lib\InnerBrowser::seeInField()
- */
- public function seeInField($field, $value) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that an input field or textarea doesn't contain the given value.
- * For fuzzy locators, the field is matched by label text, CSS and XPath.
- *
- * ``` php
- * dontSeeInField('Body','Type your comment here');
- * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
- * $I->dontSeeInField('form input[type=hidden]','hidden_value');
- * $I->dontSeeInField('#searchform input','Search');
- * $I->dontSeeInField('//form/*[@name=search]','Search');
- * $I->dontSeeInField(['name' => 'search'], 'Search');
- * ?>
- * ```
- *
- * @param $field
- * @param $value
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
- */
- public function cantSeeInField($field, $value) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that an input field or textarea doesn't contain the given value.
- * For fuzzy locators, the field is matched by label text, CSS and XPath.
- *
- * ``` php
- * dontSeeInField('Body','Type your comment here');
- * $I->dontSeeInField('form textarea[name=body]','Type your comment here');
- * $I->dontSeeInField('form input[type=hidden]','hidden_value');
- * $I->dontSeeInField('#searchform input','Search');
- * $I->dontSeeInField('//form/*[@name=search]','Search');
- * $I->dontSeeInField(['name' => 'search'], 'Search');
- * ?>
- * ```
- *
- * @param $field
- * @param $value
- * @see \Codeception\Lib\InnerBrowser::dontSeeInField()
- */
- public function dontSeeInField($field, $value) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if the array of form parameters (name => value) are set on the form matched with the
- * passed selector.
- *
- * ``` php
- * seeInFormFields('form[name=myform]', [
- * 'input1' => 'value',
- * 'input2' => 'other value',
- * ]);
- * ?>
- * ```
- *
- * For multi-select elements, or to check values of multiple elements with the same name, an
- * array may be passed:
- *
- * ``` php
- * seeInFormFields('.form-class', [
- * 'multiselect' => [
- * 'value1',
- * 'value2',
- * ],
- * 'checkbox[]' => [
- * 'a checked value',
- * 'another checked value',
- * ],
- * ]);
- * ?>
- * ```
- *
- * Additionally, checkbox values can be checked with a boolean.
- *
- * ``` php
- * seeInFormFields('#form-id', [
- * 'checkbox1' => true, // passes if checked
- * 'checkbox2' => false, // passes if unchecked
- * ]);
- * ?>
- * ```
- *
- * Pair this with submitForm for quick testing magic.
- *
- * ``` php
- * 'value',
- * 'field2' => 'another value',
- * 'checkbox1' => true,
- * // ...
- * ];
- * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
- * // $I->amOnPage('/path/to/form-page') may be needed
- * $I->seeInFormFields('//form[@id=my-form]', $form);
- * ?>
- * ```
- *
- * @param $formSelector
- * @param $params
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
- */
- public function canSeeInFormFields($formSelector, $params) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if the array of form parameters (name => value) are set on the form matched with the
- * passed selector.
- *
- * ``` php
- * seeInFormFields('form[name=myform]', [
- * 'input1' => 'value',
- * 'input2' => 'other value',
- * ]);
- * ?>
- * ```
- *
- * For multi-select elements, or to check values of multiple elements with the same name, an
- * array may be passed:
- *
- * ``` php
- * seeInFormFields('.form-class', [
- * 'multiselect' => [
- * 'value1',
- * 'value2',
- * ],
- * 'checkbox[]' => [
- * 'a checked value',
- * 'another checked value',
- * ],
- * ]);
- * ?>
- * ```
- *
- * Additionally, checkbox values can be checked with a boolean.
- *
- * ``` php
- * seeInFormFields('#form-id', [
- * 'checkbox1' => true, // passes if checked
- * 'checkbox2' => false, // passes if unchecked
- * ]);
- * ?>
- * ```
- *
- * Pair this with submitForm for quick testing magic.
- *
- * ``` php
- * 'value',
- * 'field2' => 'another value',
- * 'checkbox1' => true,
- * // ...
- * ];
- * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
- * // $I->amOnPage('/path/to/form-page') may be needed
- * $I->seeInFormFields('//form[@id=my-form]', $form);
- * ?>
- * ```
- *
- * @param $formSelector
- * @param $params
- * @see \Codeception\Lib\InnerBrowser::seeInFormFields()
- */
- public function seeInFormFields($formSelector, $params) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if the array of form parameters (name => value) are not set on the form matched with
- * the passed selector.
- *
- * ``` php
- * dontSeeInFormFields('form[name=myform]', [
- * 'input1' => 'non-existent value',
- * 'input2' => 'other non-existent value',
- * ]);
- * ?>
- * ```
- *
- * To check that an element hasn't been assigned any one of many values, an array can be passed
- * as the value:
- *
- * ``` php
- * dontSeeInFormFields('.form-class', [
- * 'fieldName' => [
- * 'This value shouldn\'t be set',
- * 'And this value shouldn\'t be set',
- * ],
- * ]);
- * ?>
- * ```
- *
- * Additionally, checkbox values can be checked with a boolean.
- *
- * ``` php
- * dontSeeInFormFields('#form-id', [
- * 'checkbox1' => true, // fails if checked
- * 'checkbox2' => false, // fails if unchecked
- * ]);
- * ?>
- * ```
- *
- * @param $formSelector
- * @param $params
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
- */
- public function cantSeeInFormFields($formSelector, $params) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if the array of form parameters (name => value) are not set on the form matched with
- * the passed selector.
- *
- * ``` php
- * dontSeeInFormFields('form[name=myform]', [
- * 'input1' => 'non-existent value',
- * 'input2' => 'other non-existent value',
- * ]);
- * ?>
- * ```
- *
- * To check that an element hasn't been assigned any one of many values, an array can be passed
- * as the value:
- *
- * ``` php
- * dontSeeInFormFields('.form-class', [
- * 'fieldName' => [
- * 'This value shouldn\'t be set',
- * 'And this value shouldn\'t be set',
- * ],
- * ]);
- * ?>
- * ```
- *
- * Additionally, checkbox values can be checked with a boolean.
- *
- * ``` php
- * dontSeeInFormFields('#form-id', [
- * 'checkbox1' => true, // fails if checked
- * 'checkbox2' => false, // fails if unchecked
- * ]);
- * ?>
- * ```
- *
- * @param $formSelector
- * @param $params
- * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields()
- */
- public function dontSeeInFormFields($formSelector, $params) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Submits the given form on the page, optionally with the given form values.
- * Give the form fields values as an array.
- *
- * Skipped fields will be filled by their values from the page.
- * You don't need to click the 'Submit' button afterwards.
- * This command itself triggers the request to form's action.
- *
- * You can optionally specify what button's value to include
- * in the request with the last parameter as an alternative to
- * explicitly setting its value in the second parameter, as
- * button values are not otherwise included in the request.
- *
- * Examples:
- *
- * ``` php
- * submitForm('#login', array('login' => 'davert', 'password' => '123456'));
- * // or
- * $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName');
- *
- * ```
- *
- * For example, given this sample "Sign Up" form:
- *
- * ``` html
- *
- * ```
- *
- * You could write the following to submit it:
- *
- * ``` php
- * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton');
- *
- * ```
- * Note that "2" will be the submitted value for the "plan" field, as it is the selected option.
- *
- * You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm.
- *
- * ```php
- * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
- *
- * ```
- *
- * Pair this with seeInFormFields for quick testing magic.
- *
- * ``` php
- * 'value',
- * 'field2' => 'another value',
- * 'checkbox1' => true,
- * // ...
- * ];
- * $I->submitForm('//form[@id=my-form]', $form, 'submitButton');
- * // $I->amOnPage('/path/to/form-page') may be needed
- * $I->seeInFormFields('//form[@id=my-form]', $form);
- * ?>
- * ```
- *
- * Parameter values can be set to arrays for multiple input fields
- * of the same name, or multi-select combo boxes. For checkboxes,
- * either the string value can be used, or boolean values which will
- * be replaced by the checkbox's value in the DOM.
- *
- * ``` php
- * submitForm('#my-form', [
- * 'field1' => 'value',
- * 'checkbox' => [
- * 'value of first checkbox',
- * 'value of second checkbox,
- * ],
- * 'otherCheckboxes' => [
- * true,
- * false,
- * false
- * ],
- * 'multiselect' => [
- * 'first option value',
- * 'second option value'
- * ]
- * ]);
- * ?>
- * ```
- *
- * Mixing string and boolean values for a checkbox's value is not
- * supported and may produce unexpected results.
- *
- * @param $selector
- * @param $params
- * @param $button
- * @see \Codeception\Lib\InnerBrowser::submitForm()
- */
- public function submitForm($selector, $params, $button = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('submitForm', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Fills a text field or textarea with the given string.
- *
- * ``` php
- * fillField("//input[@type='text']", "Hello World!");
- * $I->fillField(['name' => 'email'], 'jon@mail.com');
- * ?>
- * ```
- *
- * @param $field
- * @param $value
- * @see \Codeception\Lib\InnerBrowser::fillField()
- */
- public function fillField($field, $value) {
- return $this->scenario->runStep(new \Codeception\Step\Action('fillField', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Selects an option in a select tag or in radio button group.
- *
- * ``` php
- * selectOption('form select[name=account]', 'Premium');
- * $I->selectOption('form input[name=payment]', 'Monthly');
- * $I->selectOption('//form/select[@name=account]', 'Monthly');
- * ?>
- * ```
- *
- * Provide an array for the second argument to select multiple options:
- *
- * ``` php
- * selectOption('Which OS do you use?', array('Windows','Linux'));
- * ?>
- * ```
- *
- * @param $select
- * @param $option
- * @see \Codeception\Lib\InnerBrowser::selectOption()
- */
- public function selectOption($select, $option) {
- return $this->scenario->runStep(new \Codeception\Step\Action('selectOption', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Ticks a checkbox. For radio buttons, use the `selectOption` method instead.
- *
- * ``` php
- * checkOption('#agree');
- * ?>
- * ```
- *
- * @param $option
- * @see \Codeception\Lib\InnerBrowser::checkOption()
- */
- public function checkOption($option) {
- return $this->scenario->runStep(new \Codeception\Step\Action('checkOption', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Unticks a checkbox.
- *
- * ``` php
- * uncheckOption('#notify');
- * ?>
- * ```
- *
- * @param $option
- * @see \Codeception\Lib\InnerBrowser::uncheckOption()
- */
- public function uncheckOption($option) {
- return $this->scenario->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Attaches a file relative to the Codeception data directory to the given file upload field.
- *
- * ``` php
- * attachFile('input[@type="file"]', 'prices.xls');
- * ?>
- * ```
- *
- * @param $field
- * @param $filename
- * @see \Codeception\Lib\InnerBrowser::attachFile()
- */
- public function attachFile($field, $filename) {
- return $this->scenario->runStep(new \Codeception\Step\Action('attachFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * If your page triggers an ajax request, you can perform it manually.
- * This action sends a GET ajax request with specified params.
- *
- * See ->sendAjaxPostRequest for examples.
- *
- * @param $uri
- * @param $params
- * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest()
- */
- public function sendAjaxGetRequest($uri, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * If your page triggers an ajax request, you can perform it manually.
- * This action sends a POST ajax request with specified params.
- * Additional params can be passed as array.
- *
- * Example:
- *
- * Imagine that by clicking checkbox you trigger ajax request which updates user settings.
- * We emulate that click by running this ajax request manually.
- *
- * ``` php
- * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST
- * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET
- *
- * ```
- *
- * @param $uri
- * @param $params
- * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest()
- */
- public function sendAjaxPostRequest($uri, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * If your page triggers an ajax request, you can perform it manually.
- * This action sends an ajax request with specified method and params.
- *
- * Example:
- *
- * You need to perform an ajax request specifying the HTTP method.
- *
- * ``` php
- * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title'));
- *
- * ```
- *
- * @param $method
- * @param $uri
- * @param $params
- * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest()
- */
- public function sendAjaxRequest($method, $uri, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Finds and returns the text contents of the given element.
- * If a fuzzy locator is used, the element is found using CSS, XPath, and by matching the full page source by regular expression.
- *
- * ``` php
- * grabTextFrom('h1');
- * $heading = $I->grabTextFrom('descendant-or-self::h1');
- * $value = $I->grabTextFrom('~
- * ```
- *
- * @param $cssOrXPathOrRegex
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::grabTextFrom()
- */
- public function grabTextFrom($cssOrXPathOrRegex) {
- return $this->scenario->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Grabs the value of the given attribute value from the given element.
- * Fails if element is not found.
- *
- * ``` php
- * grabAttributeFrom('#tooltip', 'title');
- * ?>
- * ```
- *
- *
- * @param $cssOrXpath
- * @param $attribute
- * @internal param $element
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom()
- */
- public function grabAttributeFrom($cssOrXpath, $attribute) {
- return $this->scenario->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * @param $field
- *
- * @return array|mixed|null|string
- * @see \Codeception\Lib\InnerBrowser::grabValueFrom()
- */
- public function grabValueFrom($field) {
- return $this->scenario->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args()));
- }
-
-
- /**
- * [!] 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
- * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3');
- * ?>
- * ```
- *
- * @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, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('setCookie', func_get_args()));
- }
-
-
- /**
- * [!] 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, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('grabCookie', 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
- * seeCookie('PHPSESSID');
- * ?>
- * ```
- *
- * @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, $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
- * seeCookie('PHPSESSID');
- * ?>
- * ```
- *
- * @param $cookie
- * @param array $params
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::seeCookie()
- */
- public function seeCookie($name, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeCookie', 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
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeCookie()
- */
- 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, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args()));
- }
-
-
- /**
- * [!] 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, $params = null) {
- return $this->scenario->runStep(new \Codeception\Step\Action('resetCookie', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given element exists on the page and is visible.
- * You can also specify expected attributes of this element.
- *
- * ``` php
- * seeElement('.error');
- * $I->seeElement('//form/input[1]');
- * $I->seeElement('input', ['name' => 'login']);
- * $I->seeElement('input', ['value' => '123456']);
- *
- * // strict locator in first arg, attributes in second
- * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
- * ?>
- * ```
- *
- * @param $selector
- * @param array $attributes
- * @return
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeElement()
- */
- public function canSeeElement($selector, $attributes = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given element exists on the page and is visible.
- * You can also specify expected attributes of this element.
- *
- * ``` php
- * seeElement('.error');
- * $I->seeElement('//form/input[1]');
- * $I->seeElement('input', ['name' => 'login']);
- * $I->seeElement('input', ['value' => '123456']);
- *
- * // strict locator in first arg, attributes in second
- * $I->seeElement(['css' => 'form input'], ['name' => 'login']);
- * ?>
- * ```
- *
- * @param $selector
- * @param array $attributes
- * @return
- * @see \Codeception\Lib\InnerBrowser::seeElement()
- */
- public function seeElement($selector, $attributes = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given element is invisible or not present on the page.
- * You can also specify expected attributes of this element.
- *
- * ``` php
- * dontSeeElement('.error');
- * $I->dontSeeElement('//form/input[1]');
- * $I->dontSeeElement('input', ['name' => 'login']);
- * $I->dontSeeElement('input', ['value' => '123456']);
- * ?>
- * ```
- *
- * @param $selector
- * @param array $attributes
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
- */
- public function cantSeeElement($selector, $attributes = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given element is invisible or not present on the page.
- * You can also specify expected attributes of this element.
- *
- * ``` php
- * dontSeeElement('.error');
- * $I->dontSeeElement('//form/input[1]');
- * $I->dontSeeElement('input', ['name' => 'login']);
- * $I->dontSeeElement('input', ['value' => '123456']);
- * ?>
- * ```
- *
- * @param $selector
- * @param array $attributes
- * @see \Codeception\Lib\InnerBrowser::dontSeeElement()
- */
- public function dontSeeElement($selector, $attributes = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that there are a certain number of elements matched by the given locator on the page.
- *
- * ``` php
- * seeNumberOfElements('tr', 10);
- * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
- * ?>
- * ```
- * @param $selector
- * @param mixed $expected:
- * - string: strict number
- * - array: range of numbers [0,10]
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
- */
- public function canSeeNumberOfElements($selector, $expected) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that there are a certain number of elements matched by the given locator on the page.
- *
- * ``` php
- * seeNumberOfElements('tr', 10);
- * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements
- * ?>
- * ```
- * @param $selector
- * @param mixed $expected:
- * - string: strict number
- * - array: range of numbers [0,10]
- * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements()
- */
- public function seeNumberOfElements($selector, $expected) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given option is selected.
- *
- * ``` php
- * seeOptionIsSelected('#form input[name=payment]', 'Visa');
- * ?>
- * ```
- *
- * @param $selector
- * @param $optionText
- *
- * @return mixed
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
- */
- public function canSeeOptionIsSelected($select, $optionText) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given option is selected.
- *
- * ``` php
- * seeOptionIsSelected('#form input[name=payment]', 'Visa');
- * ?>
- * ```
- *
- * @param $selector
- * @param $optionText
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected()
- */
- public function seeOptionIsSelected($select, $optionText) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given option is not selected.
- *
- * ``` php
- * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
- * ?>
- * ```
- *
- * @param $selector
- * @param $optionText
- *
- * @return mixed
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
- */
- public function cantSeeOptionIsSelected($select, $optionText) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the given option is not selected.
- *
- * ``` php
- * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
- * ?>
- * ```
- *
- * @param $selector
- * @param $optionText
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected()
- */
- public function dontSeeOptionIsSelected($select, $optionText) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Asserts that current page has 404 response status code.
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
- */
- public function canSeePageNotFound() {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Asserts that current page has 404 response status code.
- * @see \Codeception\Lib\InnerBrowser::seePageNotFound()
- */
- public function seePageNotFound() {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that response code is equal to value provided.
- *
- * @param $code
- *
- * @return mixed
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
- */
- public function canSeeResponseCodeIs($code) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that response code is equal to value provided.
- *
- * @param $code
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs()
- */
- public function seeResponseCodeIs($code) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page title contains the given string.
- *
- * ``` php
- * seeInTitle('Blog - Post #1');
- * ?>
- * ```
- *
- * @param $title
- *
- * @return mixed
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::seeInTitle()
- */
- public function canSeeInTitle($title) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page title contains the given string.
- *
- * ``` php
- * seeInTitle('Blog - Post #1');
- * ?>
- * ```
- *
- * @param $title
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::seeInTitle()
- */
- public function seeInTitle($title) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page title does not contain the given string.
- *
- * @param $title
- *
- * @return mixed
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
- */
- public function cantSeeInTitle($title) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks that the page title does not contain the given string.
- *
- * @param $title
- *
- * @return mixed
- * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle()
- */
- public function dontSeeInTitle($title) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
- }
-}
diff --git a/tests/functional.suite.yml b/tests/functional.suite.yml
deleted file mode 100644
index 3b17a39dc..000000000
--- a/tests/functional.suite.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# Codeception Test Suite Configuration
-
-# suite for functional (integration) tests.
-# emulate web requests and make application process them.
-# Include one of framework modules (Symfony2, Yii2, Laravel4) to use it.
-
-class_name: FunctionalTester
-modules:
- enabled: [Filesystem, FunctionalHelper]
diff --git a/tests/functional/FunctionalTester.php b/tests/functional/FunctionalTester.php
deleted file mode 100644
index 881603c17..000000000
--- a/tests/functional/FunctionalTester.php
+++ /dev/null
@@ -1,360 +0,0 @@
-scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Opens a file and stores it's content.
- *
- * Usage:
- *
- * ``` php
- * openFile('composer.json');
- * $I->seeInThisFile('codeception/codeception');
- * ?>
- * ```
- *
- * @param $filename
- * @see \Codeception\Module\Filesystem::openFile()
- */
- public function openFile($filename) {
- return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Deletes a file
- *
- * ``` php
- * deleteFile('composer.lock');
- * ?>
- * ```
- *
- * @param $filename
- * @see \Codeception\Module\Filesystem::deleteFile()
- */
- public function deleteFile($filename) {
- return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Deletes directory with all subdirectories
- *
- * ``` php
- * deleteDir('vendor');
- * ?>
- * ```
- *
- * @param $dirname
- * @see \Codeception\Module\Filesystem::deleteDir()
- */
- public function deleteDir($dirname) {
- return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Copies directory with all contents
- *
- * ``` php
- * copyDir('vendor','old_vendor');
- * ?>
- * ```
- *
- * @param $src
- * @param $dst
- * @see \Codeception\Module\Filesystem::copyDir()
- */
- public function copyDir($src, $dst) {
- return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks If opened file has `text` in it.
- *
- * Usage:
- *
- * ``` php
- * openFile('composer.json');
- * $I->seeInThisFile('codeception/codeception');
- * ?>
- * ```
- *
- * @param $text
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Module\Filesystem::seeInThisFile()
- */
- public function canSeeInThisFile($text) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks If opened file has `text` in it.
- *
- * Usage:
- *
- * ``` php
- * openFile('composer.json');
- * $I->seeInThisFile('codeception/codeception');
- * ?>
- * ```
- *
- * @param $text
- * @see \Codeception\Module\Filesystem::seeInThisFile()
- */
- public function seeInThisFile($text) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks the strict matching of file contents.
- * Unlike `seeInThisFile` will fail if file has something more than expected lines.
- * Better to use with HEREDOC strings.
- * Matching is done after removing "\r" chars from file content.
- *
- * ``` php
- * openFile('process.pid');
- * $I->seeFileContentsEqual('3192');
- * ?>
- * ```
- *
- * @param $text
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
- */
- public function canSeeFileContentsEqual($text) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks the strict matching of file contents.
- * Unlike `seeInThisFile` will fail if file has something more than expected lines.
- * Better to use with HEREDOC strings.
- * Matching is done after removing "\r" chars from file content.
- *
- * ``` php
- * openFile('process.pid');
- * $I->seeFileContentsEqual('3192');
- * ?>
- * ```
- *
- * @param $text
- * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
- */
- public function seeFileContentsEqual($text) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks If opened file doesn't contain `text` in it
- *
- * ``` php
- * openFile('composer.json');
- * $I->dontSeeInThisFile('codeception/codeception');
- * ?>
- * ```
- *
- * @param $text
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
- */
- public function cantSeeInThisFile($text) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks If opened file doesn't contain `text` in it
- *
- * ``` php
- * openFile('composer.json');
- * $I->dontSeeInThisFile('codeception/codeception');
- * ?>
- * ```
- *
- * @param $text
- * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
- */
- public function dontSeeInThisFile($text) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Deletes a file
- * @see \Codeception\Module\Filesystem::deleteThisFile()
- */
- public function deleteThisFile() {
- return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if file exists in path.
- * Opens a file when it's exists
- *
- * ``` php
- * seeFileFound('UserModel.php','app/models');
- * ?>
- * ```
- *
- * @param $filename
- * @param string $path
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Module\Filesystem::seeFileFound()
- */
- public function canSeeFileFound($filename, $path = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if file exists in path.
- * Opens a file when it's exists
- *
- * ``` php
- * seeFileFound('UserModel.php','app/models');
- * ?>
- * ```
- *
- * @param $filename
- * @param string $path
- * @see \Codeception\Module\Filesystem::seeFileFound()
- */
- public function seeFileFound($filename, $path = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if file does not exists in path
- *
- * @param $filename
- * @param string $path
- * Conditional Assertion: Test won't be stopped on fail
- * @see \Codeception\Module\Filesystem::dontSeeFileFound()
- */
- public function cantSeeFileFound($filename, $path = null) {
- return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
- }
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Checks if file does not exists in path
- *
- * @param $filename
- * @param string $path
- * @see \Codeception\Module\Filesystem::dontSeeFileFound()
- */
- public function dontSeeFileFound($filename, $path = null) {
- return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Erases directory contents
- *
- * ``` php
- * cleanDir('logs');
- * ?>
- * ```
- *
- * @param $dirname
- * @see \Codeception\Module\Filesystem::cleanDir()
- */
- public function cleanDir($dirname) {
- return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
- }
-
-
- /**
- * [!] Method is generated. Documentation taken from corresponding module.
- *
- * Saves contents to file
- *
- * @param $filename
- * @param $contents
- * @see \Codeception\Module\Filesystem::writeToFile()
- */
- public function writeToFile($filename, $contents) {
- return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
- }
-}
diff --git a/tests/functional/_bootstrap.php b/tests/functional/_bootstrap.php
deleted file mode 100644
index 8a8855580..000000000
--- a/tests/functional/_bootstrap.php
+++ /dev/null
@@ -1,2 +0,0 @@
-installTester = $I;
- }
-
- /**
- * @return installPage
- */
- public static function of(InstallTester $I)
- {
- return new static($I);
- }
-}
\ No newline at end of file
diff --git a/tests/install/_steps/AdminSteps.php b/tests/install/_steps/AdminSteps.php
deleted file mode 100644
index 191c9ba9c..000000000
--- a/tests/install/_steps/AdminSteps.php
+++ /dev/null
@@ -1,18 +0,0 @@
-loadFile(array('./common/js/common.js', 'head'));
$handler->loadFile(array('./common/js/xml_js_filter.js', 'body'));
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ } else {
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
+ }
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
$this->assertEquals($handler->getJsFileList(), $expected);
@@ -33,7 +38,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$handler->loadFile(array('./common/js/jquery.js', 'body'));
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head'));
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ }
+ else
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
+ }
$this->assertEquals($handler->getJsFileList('body'), $expected);
});
@@ -42,8 +54,16 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$handler->loadFile(array('./common/css/xe.css'));
$handler->loadFile(array('./common/css/mobile.css'));
- $expected[] = array('file' => '/xe/common/css/xe.css' . $this->_filemtime('common/css/xe.css'), 'media' => 'all', 'targetie' => null);
- $expected[] = array('file' => '/xe/common/css/mobile.css' . $this->_filemtime('common/css/mobile.css'), 'media' => 'all', 'targetie' => null);
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/css/xe.css' . $this->_filemtime('common/css/xe.css'), 'media' => 'all', 'targetie' => null);
+ $expected[] = array('file' => '/xe/common/css/mobile.css' . $this->_filemtime('common/css/mobile.css'), 'media' => 'all', 'targetie' => null);
+ }
+ else
+ {
+ $expected[] = array('file' => '/xe/common/css/xe.min.css' . $this->_filemtime('common/css/xe.min.css'), 'media' => 'all', 'targetie' => null);
+ $expected[] = array('file' => '/xe/common/css/mobile.min.css' . $this->_filemtime('common/css/mobile.min.css'), 'media' => 'all', 'targetie' => null);
+ }
$this->assertEquals($handler->getCssFileList(), $expected);
});
@@ -60,7 +80,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$handler->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000));
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ }
+ else
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
+ }
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
$expected[] = array('file' => '/xe/common/js/xml_handler.js' . $this->_filemtime('common/js/xml_handler.js'), 'targetie' => null);
@@ -76,7 +103,14 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$handler->loadFile(array('./common/js/common.js', 'head', '', -100000));
$handler->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000));
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => null);
+ }
+ else
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => null);
+ }
$expected[] = array('file' => '/xe/common/js/js_app.js' . $this->_filemtime('common/js/js_app.js'), 'targetie' => null);
$expected[] = array('file' => '/xe/common/js/common.js' . $this->_filemtime('common/js/common.js'), 'targetie' => null);
$expected[] = array('file' => '/xe/common/js/xml_js_filter.js' . $this->_filemtime('common/js/xml_js_filter.js'), 'targetie' => null);
@@ -106,9 +140,41 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$handler->loadFile(array('./common/js/jquery.js', 'head', 'ie7'));
$handler->loadFile(array('./common/js/jquery.js', 'head', 'ie8'));
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie6');
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie7');
- $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie8');
+ if(__DEBUG__ || !__XE_VERSION_STABLE__)
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie6');
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie7');
+ $expected[] = array('file' => '/xe/common/js/jquery.js' . $this->_filemtime('common/js/jquery.js'), 'targetie' => 'ie8');
+ }
+ else
+ {
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie6');
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie7');
+ $expected[] = array('file' => '/xe/common/js/jquery.min.js' . $this->_filemtime('common/js/jquery.min.js'), 'targetie' => 'ie8');
+ }
+ $this->assertEquals($handler->getJsFileList(), $expected);
+ });
+
+ $this->specify("external file - schemaless", function() {
+ $handler = new FrontEndFileHandler();
+ $handler->loadFile(array('http://external.host/js/script.js'));
+ $handler->loadFile(array('https://external.host/js/script.js'));
+ $handler->loadFile(array('//external.host/js/script1.js'));
+ $handler->loadFile(array('///external.host/js/script2.js'));
+
+ $expected[] = array('file' => 'http://external.host/js/script.js', 'targetie' => null);
+ $expected[] = array('file' => 'https://external.host/js/script.js', 'targetie' => null);
+ $expected[] = array('file' => '//external.host/js/script1.js', 'targetie' => null);
+ $expected[] = array('file' => '//external.host/js/script2.js', 'targetie' => null);
+ $this->assertEquals($handler->getJsFileList(), $expected);
+ });
+
+ $this->specify("external file - schemaless", function() {
+ $handler = new FrontEndFileHandler();
+ $handler->loadFile(array('//external.host/js/script.js'));
+ $handler->loadFile(array('///external.host/js/script.js'));
+
+ $expected[] = array('file' => '//external.host/js/script.js', 'targetie' => null);
$this->assertEquals($handler->getJsFileList(), $expected);
});
@@ -146,13 +212,16 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test
$this->assertEquals($handler->getCssFileList(), $expected);
});
- $this->specify("external file", function() {
+ $this->specify("external file - schemaless", function() {
$handler = new FrontEndFileHandler();
$handler->loadFile(array('//external.host/css/style.css'));
+ $handler->loadFile(array('///external.host/css2/style2.css'));
$expected[] = array('file' => '//external.host/css/style.css', 'media'=>'all', 'targetie' => null);
+ $expected[] = array('file' => '//external.host/css2/style2.css', 'media'=>'all', 'targetie' => null);
$this->assertEquals($handler->getCssFileList(), $expected);
});
+
}
}
diff --git a/tests/unit/classes/template/TemplateHandlerTest.php b/tests/unit/classes/template/TemplateHandlerTest.php
index 313dcc331..daece9612 100644
--- a/tests/unit/classes/template/TemplateHandlerTest.php
+++ b/tests/unit/classes/template/TemplateHandlerTest.php
@@ -213,7 +213,7 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
// issue 584
array(
' ',
- PHP_EOL . 'if($__Context->oBodex->display_extra_images[\'mobile\'] && $__Context->arr_extra && $__Context->arr_extra->bodex->mobile){ ?> '
+ PHP_EOL . 'if($__Context->oBodex->display_extra_images[\'mobile\'] && $__Context->arr_extra && $__Context->arr_extra->bodex->mobile){ ?> '
),
// issue 831
array(
@@ -230,6 +230,55 @@ class TemplateHandlerTest extends \Codeception\TestCase\Test
'{@ eval(\'$val = $document_srl;\')}',
PHP_EOL . 'eval(\'$__Context->val = $__Context->document_srl;\') ?>'
),
+ // https://github.com/xpressengine/xe-core/issues/1510
+ array(
+ ' ',
+ PHP_EOL . 'if($__Context->foo->bar){ ?> '
+ ),
+ // https://github.com/xpressengine/xe-core/issues/1510
+ array(
+ ' ',
+ PHP_EOL . 'if($__Context->foo->bar > 100){ ?> '
+ ),
+ // https://github.com/xpressengine/xe-core/issues/1510
+ array(
+ ' ',
+ PHP_EOL . 'if($__Context->foo->bar){ ?> '
+ ),
+ // https://github.com/xpressengine/xe-core/issues/1510
+ array(
+ ' ',
+ PHP_EOL . 'if(!$__Context->module_info->title){ ?> '
+ ),
+ // https://github.com/xpressengine/xe-core/issues/1510
+ array(
+ ' use" src="../img/common/blank.gif" />',
+ PHP_EOL . 'if($__Context->mi->title){ ?> mi->use){ ?> class="tmp_class" src="/xe/tests/unit/classes/img/common/blank.gif" />'
+ ),
+ array(
+ ' ',
+ '?> foo->bar){ ?> '
+ ),
+ array(
+ '' . "\n" . ' ',
+ '?>' . PHP_EOL . ' foo->bar){ ?> '
+ ),
+ array(
+ 'asf ',
+ '?>asf '
+ ),
+ array(
+ ' ',
+ '?> '
+ ),
+ array(
+ 'asdf src="../img/img.gif" asdf asdf src="../img/img.gif" asdf',
+ '?>asdf src="../img/img.gif" asdf asdf src="../img/img.gif" asdf'
+ ),
+ array(
+ 'asdf src="../img/img.gif" asdf',
+ '?>asdf src="../img/img.gif" asdf'
+ ),
);
}
diff --git a/tools/dbxml_validator/connect_wrapper.php b/tools/dbxml_validator/connect_wrapper.php
index 0d5afda6d..f9ebacf48 100644
--- a/tools/dbxml_validator/connect_wrapper.php
+++ b/tools/dbxml_validator/connect_wrapper.php
@@ -347,7 +347,7 @@ class DBMysqliConnectWrapper extends DBMysqli
*/
public function addQuotes($string)
{
- if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc())
+ if(version_compare(PHP_VERSION, "5.4.0", "<") && get_magic_quotes_gpc())
{
$string = stripslashes(str_replace("\\", "\\\\", $string));
}
|