diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..c0564c2 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,4 @@ +service_name: travis-ci +src_dir: framework/yii +coverage_clover: tests/unit/runtime/coveralls/clover.xml +json_path: tests/unit/runtime/coveralls/coveralls-upload.json \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..818cb6a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +# Autodetect text files +* text=auto + +# ...Unless the name matches the following overriding patterns + +# Definitively text files +*.php text +*.css text +*.js text +*.txt text +*.md text +*.xml text +*.json text +*.bat text +*.sql text +*.xml text +*.yml text + +# Ensure those won't be messed up with +*.png binary +*.jpg binary +*.gif binary +*.ttf binary diff --git a/.gitignore b/.gitignore index 832a890..f2915a9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,10 @@ nbproject Thumbs.db # composer vendor dir -/yii/vendor \ No newline at end of file +/yii/vendor + +# composer itself is not needed +composer.phar + +# Mac DS_Store Files +.DS_Store diff --git a/.travis.yml b/.travis.yml index e4b8278..a905b36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,24 @@ language: php php: - - 5.3 - 5.4 - 5.5 -env: - - DB=mysql +services: + - redis-server + - memcached before_script: - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS yiitest;'; fi" + - composer self-update && composer --version + - composer require satooshi/php-coveralls 0.6.* + - mysql -e 'CREATE DATABASE yiitest;'; + - psql -U postgres -c 'CREATE DATABASE yiitest;'; + - tests/unit/data/travis/apc-setup.sh + - tests/unit/data/travis/memcache-setup.sh + - tests/unit/data/travis/cubrid-setup.sh -script: phpunit \ No newline at end of file +script: + - phpunit --coverage-clover tests/unit/runtime/coveralls/clover.xml --verbose --exclude-group mssql,oci,wincache,xcache,zenddata + +after_script: + - php vendor/bin/coveralls diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..6edcc4f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,32 @@ +The Yii framework is free software. It is released under the terms of +the following BSD License. + +Copyright © 2008-2013 by Yii Software LLC (http://www.yiisoft.com) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Yii Software LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc03ac7 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +Yii 2.0 Public Preview +====================== + +Thank you for choosing Yii - a high-performance component-based PHP framework. + +If you are looking for a production-ready PHP framework, please use +[Yii v1.1](https://github.com/yiisoft/yii). + +Yii 2.0 is still under heavy development. We may make significant changes +without prior notices. **Yii 2.0 is not ready for production use yet.** + +[](https://packagist.org/packages/yiisoft/yii2) +[](https://packagist.org/packages/yiisoft/yii2) +[](http://travis-ci.org/yiisoft/yii2) +[](https://www.versioneye.com/php/yiisoft:yii2/dev-master) + + +DIRECTORY STRUCTURE +------------------- + + apps/ ready-to-use Web apps built on Yii 2 + advanced/ advanced app template with complex features + basic/ a simple app supporting user login and contact page + benchmark/ app demonstrating the minimal overhead introduced by the framework + build/ internally used build tools + docs/ documentation + extensions/ extensions + framework/ framework files + yii/ framework source files + tests/ tests of the core framework code + + +REQUIREMENTS +------------ + +The minimum requirement by Yii is that your Web server supports PHP 5.3.?. + + +DOCUMENTATION +------------- + +For 1.1 users, you may refer to [Upgrading from Yii 1.1](docs/guide/upgrade-from-v1.md) +to have a general idea of what has changed in 2.0. + +[Definitive Guide draft](docs/guide/index.md) is available. It's not complete yet but main parts are already OK. + + +HOW TO PARTICIPATE +------------------ + +**Your participation to Yii 2 development is very welcome!** + +You may participate in the following ways: + +* [Report issues](https://github.com/yiisoft/yii2/issues) +* [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-design-discussions-for-yii-20/) +* Fix issues, develop features, write/polish documentation + - Before you start, please adopt an existing issue (labelled with "ready for adoption") or start a new one to avoid duplicated efforts. + - Please submit a merge request after you finish development. + diff --git a/apps/advanced/.gitignore b/apps/advanced/.gitignore new file mode 100644 index 0000000..19dfc06 --- /dev/null +++ b/apps/advanced/.gitignore @@ -0,0 +1,2 @@ +/yii +/composer.lock \ No newline at end of file diff --git a/apps/advanced/LICENSE.md b/apps/advanced/LICENSE.md new file mode 100644 index 0000000..6edcc4f --- /dev/null +++ b/apps/advanced/LICENSE.md @@ -0,0 +1,32 @@ +The Yii framework is free software. It is released under the terms of +the following BSD License. + +Copyright © 2008-2013 by Yii Software LLC (http://www.yiisoft.com) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Yii Software LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/apps/advanced/README.md b/apps/advanced/README.md new file mode 100644 index 0000000..3903532 --- /dev/null +++ b/apps/advanced/README.md @@ -0,0 +1,118 @@ +Yii 2 Advanced Application Template +=================================== + +**NOTE** Yii 2 and the relevant applications and extensions are still under heavy +development. We may make significant changes without prior notices. Please do not +use them for production. Please consider using [Yii v1.1](https://github.com/yiisoft/yii) +if you have a project to be deployed for production soon. + + +Thank you for using Yii 2 Advanced Application Template - an application template +that works out-of-box and can be easily customized to fit for your needs. + +Yii 2 Advanced Application Template is best suitable for large projects requiring frontend and backend separation, +deployment in different environments, configuration nesting etc. + + +DIRECTORY STRUCTURE +------------------- + +``` +common + config/ contains shared configurations + models/ contains model classes used in both backend and frontend +console + config/ contains console configurations + controllers/ contains console controllers (commands) + migrations/ contains database migrations + models/ contains console-specific model classes + runtime/ contains files generated during runtime +backend + assets/ contains application assets such as JavaScript and CSS + config/ contains backend configurations + controllers/ contains Web controller classes + models/ contains backend-specific model classes + runtime/ contains files generated during runtime + views/ contains view files for the Web application + web/ contains the entry script and Web resources +frontend + assets/ contains application assets such as JavaScript and CSS + config/ contains frontend configurations + controllers/ contains Web controller classes + models/ contains frontend-specific model classes + runtime/ contains files generated during runtime + views/ contains view files for the Web application + web/ contains the entry script and Web resources +vendor/ contains dependent 3rd-party packages +environments/ contains environment-based overrides +``` + + + +REQUIREMENTS +------------ + +The minimum requirement by Yii is that your Web server supports PHP 5.3.?. + +In order for captcha to work you need either GD2 extension or ImageMagick PHP extension. + +INSTALLATION +------------ + +### Install via Composer + +If you do not have [Composer](http://getcomposer.org/), you may download it from +[http://getcomposer.org/](http://getcomposer.org/) or run the following command on Linux/Unix/MacOS: + +~~~ +curl -s http://getcomposer.org/installer | php +~~~ + +You can then install the application using the following command: + +~~~ +php composer.phar create-project --stability=dev yiisoft/yii2-app-advanced yii-advanced +~~~ + +Note that in order to install some dependencies you must have `php_openssl` extension enabled. + + +### Install from an Archive File + +This is not currently available. We will provide it when Yii 2 is formally released. + + +### Install from development repository + +If you've cloned the [Yii 2 framework main development repository](https://github.com/yiisoft/yii2) you +can bootstrap your application with: + +~~~ +cd yii2/apps/advanced +php composer.phar create-project +~~~ + +*Note: If the above command fails with `[RuntimeException] Not enough arguments.` run +`php composer.phar self-update` to obtain an updated version of composer which supports creating projects +from local packages.* + + +GETTING STARTED +--------------- + +After you install the application, you have to conduct the following steps to initialize +the installed application. You only need to do these once for all. + +1. Execute the `init` command and select `dev` as environment. Alternatively you can execute it as `init --env=Development` +or `init --env=Production`. +2. Create a new database. It is assumed that MySQL InnoDB is used. If not, adjust `console/migrations/m130524_201442_init.php`. +3. In `common/config/params.php` set your database details in `components.db` values. +4. Apply migrations with `yii migrate`. + +Now you should be able to access: + +- the frontend using the URL `http://localhost/yii-advanced/frontend/web/` +- the backend using the URL `http://localhost/yii-advanced/backend/web/` + +assuming `yii-advanced` is directly under the document root of your Web server. + diff --git a/apps/bootstrap/assets/.gitignore b/apps/advanced/backend/assets/.gitkeep similarity index 100% rename from apps/bootstrap/assets/.gitignore rename to apps/advanced/backend/assets/.gitkeep diff --git a/apps/advanced/backend/config/.gitignore b/apps/advanced/backend/config/.gitignore new file mode 100644 index 0000000..20da318 --- /dev/null +++ b/apps/advanced/backend/config/.gitignore @@ -0,0 +1,2 @@ +main-local.php +params-local.php \ No newline at end of file diff --git a/apps/advanced/backend/config/AppAsset.php b/apps/advanced/backend/config/AppAsset.php new file mode 100644 index 0000000..267e48c --- /dev/null +++ b/apps/advanced/backend/config/AppAsset.php @@ -0,0 +1,29 @@ + + * @since 2.0 + */ +class AppAsset extends AssetBundle +{ + public $basePath = '@webroot'; + public $baseUrl = '@web'; + public $css = array( + 'css/site.css', + ); + public $js = array( + ); + public $depends = array( + 'yii\web\YiiAsset', + 'yii\bootstrap\BootstrapAsset', + ); +} diff --git a/apps/advanced/backend/config/main.php b/apps/advanced/backend/config/main.php new file mode 100644 index 0000000..30c1825 --- /dev/null +++ b/apps/advanced/backend/config/main.php @@ -0,0 +1,42 @@ + 'app-backend', + 'basePath' => dirname(__DIR__), + 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', + 'preload' => array('log'), + 'controllerNamespace' => 'backend\controllers', + 'modules' => array( + ), + 'components' => array( + 'request' => array( + 'enableCsrfValidation' => true, + ), + 'db' => $params['components.db'], + 'cache' => $params['components.cache'], + 'user' => array( + 'identityClass' => 'common\models\User', + ), + 'log' => array( + 'traceLevel' => YII_DEBUG ? 3 : 0, + 'targets' => array( + array( + 'class' => 'yii\log\FileTarget', + 'levels' => array('error', 'warning'), + ), + ), + ), + 'errorHandler' => array( + 'errorAction' => 'site/error', + ), + ), + 'params' => $params, +); diff --git a/apps/advanced/backend/config/params.php b/apps/advanced/backend/config/params.php new file mode 100644 index 0000000..1643a70 --- /dev/null +++ b/apps/advanced/backend/config/params.php @@ -0,0 +1,4 @@ + 'admin@example.com', +); diff --git a/apps/advanced/backend/controllers/SiteController.php b/apps/advanced/backend/controllers/SiteController.php new file mode 100644 index 0000000..28f2310 --- /dev/null +++ b/apps/advanced/backend/controllers/SiteController.php @@ -0,0 +1,63 @@ + array( + 'class' => \yii\web\AccessControl::className(), + 'rules' => array( + array( + 'actions' => array('login'), + 'allow' => true, + 'roles' => array('?'), + ), + array( + 'actions' => array('logout', 'index'), + 'allow' => true, + 'roles' => array('@'), + ), + ), + ), + ); + } + + public function actions() + { + return array( + 'error' => array( + 'class' => 'yii\web\ErrorAction', + ), + ); + } + + public function actionIndex() + { + return $this->render('index'); + } + + public function actionLogin() + { + $model = new LoginForm(); + if ($model->load($_POST) && $model->login()) { + return $this->goHome(); + } else { + return $this->render('login', array( + 'model' => $model, + )); + } + } + + public function actionLogout() + { + Yii::$app->user->logout(); + return $this->goHome(); + } +} diff --git a/apps/bootstrap/protected/runtime/.gitignore b/apps/advanced/backend/models/.gitkeep similarity index 100% rename from apps/bootstrap/protected/runtime/.gitignore rename to apps/advanced/backend/models/.gitkeep diff --git a/apps/advanced/backend/runtime/.gitignore b/apps/advanced/backend/runtime/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/apps/advanced/backend/runtime/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/apps/advanced/backend/views/layouts/main.php b/apps/advanced/backend/views/layouts/main.php new file mode 100644 index 0000000..928f990 --- /dev/null +++ b/apps/advanced/backend/views/layouts/main.php @@ -0,0 +1,64 @@ + +beginPage(); ?> + + +
+ ++ The above error occurred while the Web server was processing your request. +
++ Please contact us if you think this is a server error. Thank you. +
+ +You have successfully created your Yii-powered application.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Please fill out the following fields to login:
+ +This is the About page. You may modify the following file to customize its content:
+ +
++ If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. +
+ ++ The above error occurred while the Web server was processing your request. +
++ Please contact us if you think this is a server error. Thank you. +
+ +You have successfully created your Yii-powered application.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Please fill out the following fields to login:
+ +Please fill out your email. A link to reset password will be sent there.
+ +Please choose your new password:
+ +Please fill out the following fields to signup:
+ +The path to yii framework seems to be incorrect.
'; + echo 'You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) .'.
'; + echo 'Please refer to the README on how to install Yii.
'; +} + +require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); +$requirementsChecker = new YiiRequirementChecker(); + +/** + * Adjust requirements according to your application specifics. + */ +$requirements = array( + // Database : + array( + 'name' => 'PDO extension', + 'mandatory' => true, + 'condition' => extension_loaded('pdo'), + 'by' => 'All DB-related classes', + ), + array( + 'name' => 'PDO SQLite extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_sqlite'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for SQLite database.', + ), + array( + 'name' => 'PDO MySQL extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_mysql'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for MySQL database.', + ), + // Cache : + array( + 'name' => 'Memcache extension', + 'mandatory' => false, + 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), + 'by' => 'CMemCache', + 'memo' => extension_loaded('memcached') ? 'To use memcached set CMemCache::useMemcached totrue
.' : ''
+ ),
+ array(
+ 'name' => 'APC extension',
+ 'mandatory' => false,
+ 'condition' => extension_loaded('apc') || extension_loaded('apc'),
+ 'by' => 'CApcCache',
+ ),
+ // Additional PHP extensions :
+ array(
+ 'name' => 'Mcrypt extension',
+ 'mandatory' => false,
+ 'condition' => extension_loaded('mcrypt'),
+ 'by' => 'CSecurityManager',
+ 'memo' => 'Required by encrypt and decrypt methods.'
+ ),
+ // PHP ini :
+ 'phpSafeMode' => array(
+ 'name' => 'PHP safe mode',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("safe_mode"),
+ 'by' => 'File uploading and console command execution',
+ 'memo' => '"safe_mode" should be disabled at php.ini',
+ ),
+ 'phpExposePhp' => array(
+ 'name' => 'Expose PHP',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"),
+ 'by' => 'Security reasons',
+ 'memo' => '"expose_php" should be disabled at php.ini',
+ ),
+ 'phpAllowUrlInclude' => array(
+ 'name' => 'PHP allow url include',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"),
+ 'by' => 'Security reasons',
+ 'memo' => '"allow_url_include" should be disabled at php.ini',
+ ),
+ 'phpSmtp' => array(
+ 'name' => 'PHP mail SMTP',
+ 'mandatory' => false,
+ 'condition' => strlen(ini_get('SMTP'))>0,
+ 'by' => 'Email sending',
+ 'memo' => 'PHP mail SMTP server required',
+ ),
+);
+$requirementsChecker->checkYii()->check($requirements)->render();
diff --git a/apps/advanced/vendor/.gitignore b/apps/advanced/vendor/.gitignore
new file mode 100644
index 0000000..c96a04f
--- /dev/null
+++ b/apps/advanced/vendor/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
\ No newline at end of file
diff --git a/apps/advanced/yii.bat b/apps/advanced/yii.bat
new file mode 100644
index 0000000..5e21e2e
--- /dev/null
+++ b/apps/advanced/yii.bat
@@ -0,0 +1,20 @@
+@echo off
+
+rem -------------------------------------------------------------
+rem Yii command line bootstrap script for Windows.
+rem
+rem @author Qiang Xue The path to yii framework seems to be incorrect.
'; + echo 'You need to install Yii framework via composer or adjust the framework path in file ' . basename(__FILE__) .'.
'; + echo 'Please refer to the README on how to install Yii.
'; +} + +require_once($frameworkPath . '/requirements/YiiRequirementChecker.php'); +$requirementsChecker = new YiiRequirementChecker(); + +/** + * Adjust requirements according to your application specifics. + */ +$requirements = array( + // Database : + array( + 'name' => 'PDO extension', + 'mandatory' => true, + 'condition' => extension_loaded('pdo'), + 'by' => 'All DB-related classes', + ), + array( + 'name' => 'PDO SQLite extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_sqlite'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for SQLite database.', + ), + array( + 'name' => 'PDO MySQL extension', + 'mandatory' => false, + 'condition' => extension_loaded('pdo_mysql'), + 'by' => 'All DB-related classes', + 'memo' => 'Required for MySQL database.', + ), + // Cache : + array( + 'name' => 'Memcache extension', + 'mandatory' => false, + 'condition' => extension_loaded('memcache') || extension_loaded('memcached'), + 'by' => 'CMemCache', + 'memo' => extension_loaded('memcached') ? 'To use memcached set CMemCache::useMemcached totrue
.' : ''
+ ),
+ array(
+ 'name' => 'APC extension',
+ 'mandatory' => false,
+ 'condition' => extension_loaded('apc') || extension_loaded('apc'),
+ 'by' => 'CApcCache',
+ ),
+ // Additional PHP extensions :
+ array(
+ 'name' => 'Mcrypt extension',
+ 'mandatory' => false,
+ 'condition' => extension_loaded('mcrypt'),
+ 'by' => 'CSecurityManager',
+ 'memo' => 'Required by encrypt and decrypt methods.'
+ ),
+ // PHP ini :
+ 'phpSafeMode' => array(
+ 'name' => 'PHP safe mode',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("safe_mode"),
+ 'by' => 'File uploading and console command execution',
+ 'memo' => '"safe_mode" should be disabled at php.ini',
+ ),
+ 'phpExposePhp' => array(
+ 'name' => 'Expose PHP',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("expose_php"),
+ 'by' => 'Security reasons',
+ 'memo' => '"expose_php" should be disabled at php.ini',
+ ),
+ 'phpAllowUrlInclude' => array(
+ 'name' => 'PHP allow url include',
+ 'mandatory' => false,
+ 'condition' => $requirementsChecker->checkPhpIniOff("allow_url_include"),
+ 'by' => 'Security reasons',
+ 'memo' => '"allow_url_include" should be disabled at php.ini',
+ ),
+ 'phpSmtp' => array(
+ 'name' => 'PHP mail SMTP',
+ 'mandatory' => false,
+ 'condition' => strlen(ini_get('SMTP'))>0,
+ 'by' => 'Email sending',
+ 'memo' => 'PHP mail SMTP server required',
+ ),
+);
+$requirementsChecker->checkYii()->check($requirements)->render();
diff --git a/apps/basic/runtime/.gitignore b/apps/basic/runtime/.gitignore
new file mode 100644
index 0000000..c96a04f
--- /dev/null
+++ b/apps/basic/runtime/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
\ No newline at end of file
diff --git a/apps/basic/tests/_data/dump.sql b/apps/basic/tests/_data/dump.sql
new file mode 100644
index 0000000..4bc742c
--- /dev/null
+++ b/apps/basic/tests/_data/dump.sql
@@ -0,0 +1 @@
+/* Replace this file with actual dump of your database */
\ No newline at end of file
diff --git a/apps/basic/tests/_helpers/CodeHelper.php b/apps/basic/tests/_helpers/CodeHelper.php
new file mode 100644
index 0000000..972c8f3
--- /dev/null
+++ b/apps/basic/tests/_helpers/CodeHelper.php
@@ -0,0 +1,8 @@
+wantTo('ensure that about works');
+$I->amOnPage('?r=site/about');
+$I->see('About', 'h1');
diff --git a/apps/basic/tests/acceptance/ContactCept.php b/apps/basic/tests/acceptance/ContactCept.php
new file mode 100644
index 0000000..73527ab
--- /dev/null
+++ b/apps/basic/tests/acceptance/ContactCept.php
@@ -0,0 +1,36 @@
+wantTo('ensure that contact works');
+$I->amOnPage('?r=site/contact');
+$I->see('Contact', 'h1');
+
+$I->submitForm('#contact-form', array());
+$I->see('Contact', 'h1');
+$I->see('Name cannot be blank');
+$I->see('Email cannot be blank');
+$I->see('Subject cannot be blank');
+$I->see('Body cannot be blank');
+$I->see('The verification code is incorrect');
+
+$I->submitForm('#contact-form', array(
+ 'ContactForm[name]' => 'tester',
+ 'ContactForm[email]' => 'tester.email',
+ 'ContactForm[subject]' => 'test subject',
+ 'ContactForm[body]' => 'test content',
+ 'ContactForm[verifyCode]' => 'testme',
+));
+$I->dontSee('Name cannot be blank', '.help-inline');
+$I->see('Email is not a valid email address.');
+$I->dontSee('Subject cannot be blank', '.help-inline');
+$I->dontSee('Body cannot be blank', '.help-inline');
+$I->dontSee('The verification code is incorrect', '.help-inline');
+
+$I->submitForm('#contact-form', array(
+ 'ContactForm[name]' => 'tester',
+ 'ContactForm[email]' => 'tester@example.com',
+ 'ContactForm[subject]' => 'test subject',
+ 'ContactForm[body]' => 'test content',
+ 'ContactForm[verifyCode]' => 'testme',
+));
+$I->dontSeeElement('#contact-form');
+$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
diff --git a/apps/basic/tests/acceptance/HomeCept.php b/apps/basic/tests/acceptance/HomeCept.php
new file mode 100644
index 0000000..03dc4d5
--- /dev/null
+++ b/apps/basic/tests/acceptance/HomeCept.php
@@ -0,0 +1,8 @@
+wantTo('ensure that home page works');
+$I->amOnPage('');
+$I->see('My Company');
+$I->seeLink('About');
+$I->click('About');
+$I->see('This is the About page.');
diff --git a/apps/basic/tests/acceptance/LoginCept.php b/apps/basic/tests/acceptance/LoginCept.php
new file mode 100644
index 0000000..77c4a07
--- /dev/null
+++ b/apps/basic/tests/acceptance/LoginCept.php
@@ -0,0 +1,23 @@
+wantTo('ensure that login works');
+$I->amOnPage('?r=site/login');
+$I->see('Login', 'h1');
+
+$I->submitForm('#login-form', array());
+$I->dontSee('Logout (admin)');
+$I->see('Username cannot be blank');
+$I->see('Password cannot be blank');
+
+$I->submitForm('#login-form', array(
+ 'LoginForm[username]' => 'admin',
+ 'LoginForm[password]' => 'wrong',
+));
+$I->dontSee('Logout (admin)');
+$I->see('Incorrect username or password');
+
+$I->submitForm('#login-form', array(
+ 'LoginForm[username]' => 'admin',
+ 'LoginForm[password]' => 'admin',
+));
+$I->see('Logout (admin)');
diff --git a/apps/basic/tests/acceptance/WebGuy.php b/apps/basic/tests/acceptance/WebGuy.php
new file mode 100644
index 0000000..397761c
--- /dev/null
+++ b/apps/basic/tests/acceptance/WebGuy.php
@@ -0,0 +1,1205 @@
+submitForm('#login', array('login' => 'davert', 'password' => '123456'));
+ *
+ * ```
+ *
+ * For sample Sign Up form:
+ *
+ * ``` html
+ *
+ * ```
+ * I can write this:
+ *
+ * ``` php
+ * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
+ *
+ * ```
+ * Note, that pricing plan will be set to Paid, as it's selected on page.
+ *
+ * @param $selector
+ * @param $params
+ * @see PhpBrowser::submitForm()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function submitForm($selector, $params) {
+ $this->scenario->action('submitForm', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * 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 PhpBrowser::sendAjaxPostRequest()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function sendAjaxPostRequest($uri, $params = null) {
+ $this->scenario->action('sendAjaxPostRequest', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * 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 PhpBrowser::sendAjaxGetRequest()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function sendAjaxGetRequest($uri, $params = null) {
+ $this->scenario->action('sendAjaxGetRequest', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Asserts that current page has 404 response status code.
+ * @see PhpBrowser::seePageNotFound()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seePageNotFound() {
+ $this->scenario->assertion('seePageNotFound', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that response code is equal to value provided.
+ *
+ * @param $code
+ * @return mixed
+ * @see PhpBrowser::seeResponseCodeIs()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeResponseCodeIs($code) {
+ $this->scenario->assertion('seeResponseCodeIs', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Adds HTTP authentication via username/password.
+ *
+ * @param $username
+ * @param $password
+ * @see PhpBrowser::amHttpAuthenticated()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function amHttpAuthenticated($username, $password) {
+ $this->scenario->condition('amHttpAuthenticated', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Low-level API method.
+ * If Codeception commands are not enough, use [Guzzle HTTP Client](http://guzzlephp.org/) methods directly
+ *
+ * Example:
+ *
+ * ``` php
+ * amGoingTo('Sign all requests with OAuth');
+ * $I->executeInGuzzle(function (\Guzzle\Http\Client $client) {
+ * $client->addSubscriber(new Guzzle\Plugin\Oauth\OauthPlugin(array(
+ * 'consumer_key' => '***',
+ * 'consumer_secret' => '***',
+ * 'token' => '***',
+ * 'token_secret' => '***'
+ * )));
+ * });
+ * ?>
+ * ```
+ *
+ * Not recommended this command too be used on regular basis.
+ * If Codeception lacks important Guzzle Client methods implement then and submit patches.
+ *
+ * @param callable $function
+ * @see PhpBrowser::executeInGuzzle()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function executeInGuzzle($function) {
+ $this->scenario->action('executeInGuzzle', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Opens the page.
+ *
+ * @param $page
+ * @see Mink::amOnPage()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function amOnPage($page) {
+ $this->scenario->condition('amOnPage', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Sets 'url' configuration parameter to hosts subdomain.
+ * It does not open a page on subdomain. Use `amOnPage` for that
+ *
+ * ``` php
+ * amOnSubdomain('user');
+ * $I->amOnPage('/');
+ * // moves to http://user.mysite.com/
+ * ?>
+ * ```
+ * @param $subdomain
+ * @return mixed
+ * @see Mink::amOnSubdomain()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function amOnSubdomain($subdomain) {
+ $this->scenario->condition('amOnSubdomain', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Check if current page doesn't contain the text specified.
+ * Specify the css selector to match only specific region.
+ *
+ * Examples:
+ *
+ * ```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 Mink::dontSee()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSee($text, $selector = null) {
+ $this->scenario->action('dontSee', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Check if current page contains the text specified.
+ * Specify the css selector to match only specific region.
+ *
+ * Examples:
+ *
+ * ``` 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 Mink::see()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function see($text, $selector = null) {
+ $this->scenario->assertion('see', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if there is a link with text specified.
+ * Specify url to match link with exact this url.
+ *
+ * Examples:
+ *
+ * ``` php
+ * seeLink('Logout'); // matches Logout
+ * $I->seeLink('Logout','/logout'); // matches Logout
+ *
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see Mink::seeLink()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeLink($text, $url = null) {
+ $this->scenario->assertion('seeLink', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if page doesn't contain the link with text specified.
+ * Specify url to narrow the results.
+ *
+ * Examples:
+ *
+ * ``` php
+ * dontSeeLink('Logout'); // I suppose user is not logged in
+ *
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see Mink::dontSeeLink()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeLink($text, $url = null) {
+ $this->scenario->action('dontSeeLink', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Perform a click on link or button.
+ * Link or button are found by their names or CSS selector.
+ * Submits a form if button is a submit type.
+ *
+ * If link is an image it's found by alt attribute value of image.
+ * If button is image button is found by it's value
+ * If link or button can't be found by name they are searched by CSS selector.
+ *
+ * The second parameter is a context: CSS or XPath locator to narrow the search.
+ *
+ * Examples:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ * @param $link
+ * @param $context
+ * @see Mink::click()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function click($link, $context = null) {
+ $this->scenario->action('click', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if element exists on a page, matching it by CSS or XPath
+ *
+ * ``` php
+ * seeElement('.error');
+ * $I->seeElement(//form/input[1]);
+ * ?>
+ * ```
+ * @param $selector
+ * @see Mink::seeElement()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeElement($selector) {
+ $this->scenario->assertion('seeElement', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
+ *
+ * ``` php
+ * dontSeeElement('.error');
+ * $I->dontSeeElement(//form/input[1]);
+ * ?>
+ * ```
+ * @param $selector
+ * @see Mink::dontSeeElement()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeElement($selector) {
+ $this->scenario->action('dontSeeElement', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Reloads current page
+ * @see Mink::reloadPage()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function reloadPage() {
+ $this->scenario->action('reloadPage', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Moves back in history
+ * @see Mink::moveBack()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function moveBack() {
+ $this->scenario->action('moveBack', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Moves forward in history
+ * @see Mink::moveForward()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function moveForward() {
+ $this->scenario->action('moveForward', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Fills a text field or textarea with value.
+ *
+ * @param $field
+ * @param $value
+ * @see Mink::fillField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function fillField($field, $value) {
+ $this->scenario->action('fillField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Selects an option in select tag or in radio button group.
+ *
+ * Example:
+ *
+ * ``` php
+ * selectOption('form select[name=account]', 'Premium');
+ * $I->selectOption('form input[name=payment]', 'Monthly');
+ * $I->selectOption('//form/select[@name=account]', 'Monthly');
+ * ?>
+ * ```
+ *
+ * @param $select
+ * @param $option
+ * @see Mink::selectOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function selectOption($select, $option) {
+ $this->scenario->action('selectOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Ticks a checkbox.
+ * For radio buttons use `selectOption` method.
+ *
+ * Example:
+ *
+ * ``` php
+ * checkOption('#agree');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see Mink::checkOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function checkOption($option) {
+ $this->scenario->action('checkOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Unticks a checkbox.
+ *
+ * Example:
+ *
+ * ``` php
+ * uncheckOption('#notify');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see Mink::uncheckOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function uncheckOption($option) {
+ $this->scenario->action('uncheckOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current uri contains a value
+ *
+ * ``` php
+ * seeInCurrentUrl('home');
+ * // to match: /users/1
+ * $I->seeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see Mink::seeInCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeInCurrentUrl($uri) {
+ $this->scenario->assertion('seeInCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current uri does not contain a value
+ *
+ * ``` php
+ * dontSeeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see Mink::dontSeeInCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeInCurrentUrl($uri) {
+ $this->scenario->action('dontSeeInCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is equal to value.
+ * Unlike `seeInCurrentUrl` performs a strict check.
+ *
+ * seeCurrentUrlEquals('/');
+ * ?>
+ *
+ * @param $uri
+ * @see Mink::seeCurrentUrlEquals()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCurrentUrlEquals($uri) {
+ $this->scenario->assertion('seeCurrentUrlEquals', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is not equal to value.
+ * Unlike `dontSeeInCurrentUrl` performs a strict check.
+ *
+ * dontSeeCurrentUrlEquals('/');
+ * ?>
+ *
+ * @param $uri
+ * @see Mink::dontSeeCurrentUrlEquals()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCurrentUrlEquals($uri) {
+ $this->scenario->action('dontSeeCurrentUrlEquals', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is matches a RegEx value
+ *
+ * seeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ *
+ * @param $uri
+ * @see Mink::seeCurrentUrlMatches()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCurrentUrlMatches($uri) {
+ $this->scenario->assertion('seeCurrentUrlMatches', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url does not match a RegEx value
+ *
+ * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ *
+ * @param $uri
+ * @see Mink::dontSeeCurrentUrlMatches()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCurrentUrlMatches($uri) {
+ $this->scenario->action('dontSeeCurrentUrlMatches', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::seeCookie()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCookie($cookie) {
+ $this->scenario->assertion('seeCookie', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::dontSeeCookie()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCookie($cookie) {
+ $this->scenario->action('dontSeeCookie', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::setCookie()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function setCookie($cookie, $value) {
+ $this->scenario->action('setCookie', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::resetCookie()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function resetCookie($cookie) {
+ $this->scenario->action('resetCookie', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::grabCookie()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabCookie($cookie) {
+ $this->scenario->action('grabCookie', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Takes a parameters from current URI by RegEx.
+ * If no url provided returns full URI.
+ *
+ * ``` php
+ * grabFromCurrentUrl('~$/user/(\d+)/~');
+ * $uri = $I->grabFromCurrentUrl();
+ * ?>
+ * ```
+ *
+ * @param null $uri
+ * @internal param $url
+ * @return mixed
+ * @see Mink::grabFromCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabFromCurrentUrl($uri = null) {
+ $this->scenario->action('grabFromCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Attaches file from Codeception data directory to upload field.
+ *
+ * Example:
+ *
+ * ``` php
+ * attachFile('prices.xls');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $filename
+ * @see Mink::attachFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function attachFile($field, $filename) {
+ $this->scenario->action('attachFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if option is selected in select field.
+ *
+ * ``` php
+ * seeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ * @return mixed
+ * @see Mink::seeOptionIsSelected()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeOptionIsSelected($select, $text) {
+ $this->scenario->assertion('seeOptionIsSelected', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if option is not selected in select field.
+ *
+ * ``` php
+ * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ * @return mixed
+ * @see Mink::dontSeeOptionIsSelected()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeOptionIsSelected($select, $text) {
+ $this->scenario->action('dontSeeOptionIsSelected', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Assert if the specified checkbox is checked.
+ * Use css selector or xpath to match.
+ *
+ * Example:
+ *
+ * ``` 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 Mink::seeCheckboxIsChecked()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCheckboxIsChecked($checkbox) {
+ $this->scenario->assertion('seeCheckboxIsChecked', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Assert if the specified checkbox is unchecked.
+ * Use css selector or xpath to match.
+ *
+ * Example:
+ *
+ * ``` 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 Mink::dontSeeCheckboxIsChecked()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCheckboxIsChecked($checkbox) {
+ $this->scenario->action('dontSeeCheckboxIsChecked', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that an input field or textarea contains value.
+ * Field is matched either by label or CSS or Xpath
+ *
+ * Example:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see Mink::seeInField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeInField($field, $value) {
+ $this->scenario->assertion('seeInField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that an input field or textarea doesn't contain value.
+ * Field is matched either by label or CSS or Xpath
+ * Example:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see Mink::dontSeeInField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeInField($field, $value) {
+ $this->scenario->action('dontSeeInField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Finds and returns text contents of element.
+ * Element is searched by CSS selector, XPath or matcher by regex.
+ *
+ * Example:
+ *
+ * ``` php
+ * grabTextFrom('h1');
+ * $heading = $I->grabTextFrom('descendant-or-self::h1');
+ * $value = $I->grabTextFrom('~
+ * ```
+ *
+ * @param $cssOrXPathOrRegex
+ * @return mixed
+ * @see Mink::grabTextFrom()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabTextFrom($cssOrXPathOrRegex) {
+ $this->scenario->action('grabTextFrom', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Finds and returns field and returns it's value.
+ * Searches by field name, then by CSS, then by XPath
+ *
+ * Example:
+ *
+ * ``` php
+ * grabValueFrom('Name');
+ * $name = $I->grabValueFrom('input[name=username]');
+ * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @return mixed
+ * @see Mink::grabValueFrom()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabValueFrom($field) {
+ $this->scenario->action('grabValueFrom', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Mink::grabAttribute()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabAttribute() {
+ $this->scenario->action('grabAttribute', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+}
+
diff --git a/apps/basic/tests/acceptance/_bootstrap.php b/apps/basic/tests/acceptance/_bootstrap.php
new file mode 100644
index 0000000..7dfa7c3
--- /dev/null
+++ b/apps/basic/tests/acceptance/_bootstrap.php
@@ -0,0 +1,2 @@
+wantTo('ensure that about works');
+$I->amOnPage('?r=site/about');
+$I->see('About', 'h1');
diff --git a/apps/basic/tests/functional/ContactCept.php b/apps/basic/tests/functional/ContactCept.php
new file mode 100644
index 0000000..6feafd9
--- /dev/null
+++ b/apps/basic/tests/functional/ContactCept.php
@@ -0,0 +1,36 @@
+wantTo('ensure that contact works');
+$I->amOnPage('?r=site/contact');
+$I->see('Contact', 'h1');
+
+$I->submitForm('#contact-form', array());
+$I->see('Contact', 'h1');
+$I->see('Name cannot be blank');
+$I->see('Email cannot be blank');
+$I->see('Subject cannot be blank');
+$I->see('Body cannot be blank');
+$I->see('The verification code is incorrect');
+
+$I->submitForm('#contact-form', array(
+ 'ContactForm[name]' => 'tester',
+ 'ContactForm[email]' => 'tester.email',
+ 'ContactForm[subject]' => 'test subject',
+ 'ContactForm[body]' => 'test content',
+ 'ContactForm[verifyCode]' => 'testme',
+));
+$I->dontSee('Name cannot be blank', '.help-inline');
+$I->see('Email is not a valid email address.');
+$I->dontSee('Subject cannot be blank', '.help-inline');
+$I->dontSee('Body cannot be blank', '.help-inline');
+$I->dontSee('The verification code is incorrect', '.help-inline');
+
+$I->submitForm('#contact-form', array(
+ 'ContactForm[name]' => 'tester',
+ 'ContactForm[email]' => 'tester@example.com',
+ 'ContactForm[subject]' => 'test subject',
+ 'ContactForm[body]' => 'test content',
+ 'ContactForm[verifyCode]' => 'testme',
+));
+$I->dontSeeElement('#contact-form');
+$I->see('Thank you for contacting us. We will respond to you as soon as possible.');
diff --git a/apps/basic/tests/functional/HomeCept.php b/apps/basic/tests/functional/HomeCept.php
new file mode 100644
index 0000000..1d24af6
--- /dev/null
+++ b/apps/basic/tests/functional/HomeCept.php
@@ -0,0 +1,8 @@
+wantTo('ensure that home page works');
+$I->amOnPage('');
+$I->see('My Company');
+$I->seeLink('About');
+$I->click('About');
+$I->see('This is the About page.');
diff --git a/apps/basic/tests/functional/LoginCept.php b/apps/basic/tests/functional/LoginCept.php
new file mode 100644
index 0000000..11f8f6b
--- /dev/null
+++ b/apps/basic/tests/functional/LoginCept.php
@@ -0,0 +1,23 @@
+wantTo('ensure that login works');
+$I->amOnPage('?r=site/login');
+$I->see('Login', 'h1');
+
+$I->submitForm('#login-form', array());
+$I->dontSee('Logout (admin)');
+$I->see('Username cannot be blank');
+$I->see('Password cannot be blank');
+
+$I->submitForm('#login-form', array(
+ 'LoginForm[username]' => 'admin',
+ 'LoginForm[password]' => 'wrong',
+));
+$I->dontSee('Logout (admin)');
+$I->see('Incorrect username or password');
+
+$I->submitForm('#login-form', array(
+ 'LoginForm[username]' => 'admin',
+ 'LoginForm[password]' => 'admin',
+));
+$I->see('Logout (admin)');
diff --git a/apps/basic/tests/functional/TestGuy.php b/apps/basic/tests/functional/TestGuy.php
new file mode 100644
index 0000000..767d564
--- /dev/null
+++ b/apps/basic/tests/functional/TestGuy.php
@@ -0,0 +1,1286 @@
+scenario->condition('amInPath', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Opens a file and stores it's content.
+ *
+ * Usage:
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @see Filesystem::openFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function openFile($filename) {
+ $this->scenario->action('openFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Deletes a file
+ *
+ * ``` php
+ * deleteFile('composer.lock');
+ * ?>
+ * ```
+ *
+ * @param $filename
+ * @see Filesystem::deleteFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function deleteFile($filename) {
+ $this->scenario->action('deleteFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Deletes directory with all subdirectories
+ *
+ * ``` php
+ * deleteDir('vendor');
+ * ?>
+ * ```
+ *
+ * @param $dirname
+ * @see Filesystem::deleteDir()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function deleteDir($dirname) {
+ $this->scenario->action('deleteDir', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Copies directory with all contents
+ *
+ * ``` php
+ * copyDir('vendor','old_vendor');
+ * ?>
+ * ```
+ *
+ * @param $src
+ * @param $dst
+ * @see Filesystem::copyDir()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function copyDir($src, $dst) {
+ $this->scenario->action('copyDir', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks If opened file has `text` in it.
+ *
+ * Usage:
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @see Filesystem::seeInThisFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeInThisFile($text) {
+ $this->scenario->assertion('seeInThisFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks the strict matching of file contents.
+ * Unlike `seeInThisFile` will fail if file has something more then 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 Filesystem::seeFileContentsEqual()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeFileContentsEqual($text) {
+ $this->scenario->assertion('seeFileContentsEqual', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks If opened file doesn't contain `text` in it
+ *
+ * ``` php
+ * openFile('composer.json');
+ * $I->seeInThisFile('codeception/codeception');
+ * ?>
+ * ```
+ *
+ * @param $text
+ * @see Filesystem::dontSeeInThisFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeInThisFile($text) {
+ $this->scenario->action('dontSeeInThisFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Deletes a file
+ * @see Filesystem::deleteThisFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function deleteThisFile() {
+ $this->scenario->action('deleteThisFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * 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 Filesystem::seeFileFound()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeFileFound($filename, $path = null) {
+ $this->scenario->assertion('seeFileFound', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Erases directory contents
+ *
+ * ``` php
+ * cleanDir('logs');
+ * ?>
+ * ```
+ *
+ * @param $dirname
+ * @see Filesystem::cleanDir()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function cleanDir($dirname) {
+ $this->scenario->action('cleanDir', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Adds HTTP authentication via username/password.
+ *
+ * @param $username
+ * @param $password
+ * @see Framework::amHttpAuthenticated()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function amHttpAuthenticated($username, $password) {
+ $this->scenario->condition('amHttpAuthenticated', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Opens the page.
+ * Requires relative uri as parameter
+ *
+ * Example:
+ *
+ * ``` php
+ * amOnPage('/');
+ * // opens /register page
+ * $I->amOnPage('/register');
+ * ?>
+ * ```
+ *
+ * @param $page
+ * @see Framework::amOnPage()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function amOnPage($page) {
+ $this->scenario->condition('amOnPage', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Perform a click on link or button.
+ * Link or button are found by their names or CSS selector.
+ * Submits a form if button is a submit type.
+ *
+ * If link is an image it's found by alt attribute value of image.
+ * If button is image button is found by it's value
+ * If link or button can't be found by name they are searched by CSS selector.
+ *
+ * The second parameter is a context: CSS or XPath locator to narrow the search.
+ *
+ * Examples:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ * @param $link
+ * @param $context
+ * @see Framework::click()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function click($link, $context = null) {
+ $this->scenario->action('click', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Check if current page contains the text specified.
+ * Specify the css selector to match only specific region.
+ *
+ * Examples:
+ *
+ * ``` 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 Framework::see()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function see($text, $selector = null) {
+ $this->scenario->assertion('see', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Check if current page doesn't contain the text specified.
+ * Specify the css selector to match only specific region.
+ *
+ * Examples:
+ *
+ * ```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 Framework::dontSee()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSee($text, $selector = null) {
+ $this->scenario->action('dontSee', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if there is a link with text specified.
+ * Specify url to match link with exact this url.
+ *
+ * Examples:
+ *
+ * ``` php
+ * seeLink('Logout'); // matches Logout
+ * $I->seeLink('Logout','/logout'); // matches Logout
+ *
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see Framework::seeLink()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeLink($text, $url = null) {
+ $this->scenario->assertion('seeLink', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if page doesn't contain the link with text specified.
+ * Specify url to narrow the results.
+ *
+ * Examples:
+ *
+ * ``` php
+ * dontSeeLink('Logout'); // I suppose user is not logged in
+ *
+ * ```
+ *
+ * @param $text
+ * @param null $url
+ * @see Framework::dontSeeLink()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeLink($text, $url = null) {
+ $this->scenario->action('dontSeeLink', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current uri contains a value
+ *
+ * ``` php
+ * seeInCurrentUrl('home');
+ * // to match: /users/1
+ * $I->seeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see Framework::seeInCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeInCurrentUrl($uri) {
+ $this->scenario->assertion('seeInCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current uri does not contain a value
+ *
+ * ``` php
+ * dontSeeInCurrentUrl('/users/');
+ * ?>
+ * ```
+ *
+ * @param $uri
+ * @see Framework::dontSeeInCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeInCurrentUrl($uri) {
+ $this->scenario->action('dontSeeInCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is equal to value.
+ * Unlike `seeInCurrentUrl` performs a strict check.
+ *
+ * seeCurrentUrlEquals('/');
+ * ?>
+ *
+ * @param $uri
+ * @see Framework::seeCurrentUrlEquals()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCurrentUrlEquals($uri) {
+ $this->scenario->assertion('seeCurrentUrlEquals', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is not equal to value.
+ * Unlike `dontSeeInCurrentUrl` performs a strict check.
+ *
+ * dontSeeCurrentUrlEquals('/');
+ * ?>
+ *
+ * @param $uri
+ * @see Framework::dontSeeCurrentUrlEquals()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCurrentUrlEquals($uri) {
+ $this->scenario->action('dontSeeCurrentUrlEquals', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url is matches a RegEx value
+ *
+ * seeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ *
+ * @param $uri
+ * @see Framework::seeCurrentUrlMatches()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCurrentUrlMatches($uri) {
+ $this->scenario->assertion('seeCurrentUrlMatches', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that current url does not match a RegEx value
+ *
+ * dontSeeCurrentUrlMatches('~$/users/(\d+)~');
+ * ?>
+ *
+ * @param $uri
+ * @see Framework::dontSeeCurrentUrlMatches()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCurrentUrlMatches($uri) {
+ $this->scenario->action('dontSeeCurrentUrlMatches', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Takes a parameters from current URI by RegEx.
+ * If no url provided returns full URI.
+ *
+ * ``` php
+ * grabFromCurrentUrl('~$/user/(\d+)/~');
+ * $uri = $I->grabFromCurrentUrl();
+ * ?>
+ * ```
+ *
+ * @param null $uri
+ * @internal param $url
+ * @return mixed
+ * @see Framework::grabFromCurrentUrl()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabFromCurrentUrl($uri = null) {
+ $this->scenario->action('grabFromCurrentUrl', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Assert if the specified checkbox is checked.
+ * Use css selector or xpath to match.
+ *
+ * Example:
+ *
+ * ``` 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 Framework::seeCheckboxIsChecked()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeCheckboxIsChecked($checkbox) {
+ $this->scenario->assertion('seeCheckboxIsChecked', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Assert if the specified checkbox is unchecked.
+ * Use css selector or xpath to match.
+ *
+ * Example:
+ *
+ * ``` 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 Framework::dontSeeCheckboxIsChecked()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeCheckboxIsChecked($checkbox) {
+ $this->scenario->action('dontSeeCheckboxIsChecked', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that an input field or textarea contains value.
+ * Field is matched either by label or CSS or Xpath
+ *
+ * Example:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see Framework::seeInField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeInField($field, $value) {
+ $this->scenario->assertion('seeInField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that an input field or textarea doesn't contain value.
+ * Field is matched either by label or CSS or Xpath
+ * Example:
+ *
+ * ``` 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');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $value
+ * @see Framework::dontSeeInField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeInField($field, $value) {
+ $this->scenario->action('dontSeeInField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Submits a form located on page.
+ * Specify the form by it's css or xpath selector.
+ * Fill the form fields values as array.
+ *
+ * Skipped fields will be filled by their values from page.
+ * You don't need to click the 'Submit' button afterwards.
+ * This command itself triggers the request to form's action.
+ *
+ * Examples:
+ *
+ * ``` php
+ * submitForm('#login', array('login' => 'davert', 'password' => '123456'));
+ *
+ * ```
+ *
+ * For sample Sign Up form:
+ *
+ * ``` html
+ *
+ * ```
+ * I can write this:
+ *
+ * ``` php
+ * submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
+ *
+ * ```
+ * Note, that pricing plan will be set to Paid, as it's selected on page.
+ *
+ * @param $selector
+ * @param $params
+ * @see Framework::submitForm()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function submitForm($selector, $params) {
+ $this->scenario->action('submitForm', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Fills a text field or textarea with value.
+ *
+ * @param $field
+ * @param $value
+ * @see Framework::fillField()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function fillField($field, $value) {
+ $this->scenario->action('fillField', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Selects an option in select tag or in radio button group.
+ *
+ * Example:
+ *
+ * ``` php
+ * selectOption('form select[name=account]', 'Premium');
+ * $I->selectOption('form input[name=payment]', 'Monthly');
+ * $I->selectOption('//form/select[@name=account]', 'Monthly');
+ * ?>
+ * ```
+ *
+ * @param $select
+ * @param $option
+ * @see Framework::selectOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function selectOption($select, $option) {
+ $this->scenario->action('selectOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Ticks a checkbox.
+ * For radio buttons use `selectOption` method.
+ *
+ * Example:
+ *
+ * ``` php
+ * checkOption('#agree');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see Framework::checkOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function checkOption($option) {
+ $this->scenario->action('checkOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Unticks a checkbox.
+ *
+ * Example:
+ *
+ * ``` php
+ * uncheckOption('#notify');
+ * ?>
+ * ```
+ *
+ * @param $option
+ * @see Framework::uncheckOption()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function uncheckOption($option) {
+ $this->scenario->action('uncheckOption', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Attaches file from Codeception data directory to upload field.
+ *
+ * Example:
+ *
+ * ``` php
+ * attachFile('prices.xls');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @param $filename
+ * @see Framework::attachFile()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function attachFile($field, $filename) {
+ $this->scenario->action('attachFile', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * 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 Framework::sendAjaxGetRequest()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function sendAjaxGetRequest($uri, $params = null) {
+ $this->scenario->action('sendAjaxGetRequest', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * 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 Framework::sendAjaxPostRequest()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function sendAjaxPostRequest($uri, $params = null) {
+ $this->scenario->action('sendAjaxPostRequest', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ *
+ * @see Framework::formatResponse()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function formatResponse($response) {
+ $this->scenario->action('formatResponse', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Finds and returns text contents of element.
+ * Element is searched by CSS selector, XPath or matcher by regex.
+ *
+ * Example:
+ *
+ * ``` php
+ * grabTextFrom('h1');
+ * $heading = $I->grabTextFrom('descendant-or-self::h1');
+ * $value = $I->grabTextFrom('~
+ * ```
+ *
+ * @param $cssOrXPathOrRegex
+ * @return mixed
+ * @see Framework::grabTextFrom()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabTextFrom($cssOrXPathOrRegex) {
+ $this->scenario->action('grabTextFrom', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Finds and returns field and returns it's value.
+ * Searches by field name, then by CSS, then by XPath
+ *
+ * Example:
+ *
+ * ``` php
+ * grabValueFrom('Name');
+ * $name = $I->grabValueFrom('input[name=username]');
+ * $name = $I->grabValueFrom('descendant-or-self::form/descendant::input[@name = 'username']');
+ * ?>
+ * ```
+ *
+ * @param $field
+ * @return mixed
+ * @see Framework::grabValueFrom()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function grabValueFrom($field) {
+ $this->scenario->action('grabValueFrom', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if element exists on a page, matching it by CSS or XPath
+ *
+ * ``` php
+ * seeElement('.error');
+ * $I->seeElement(//form/input[1]);
+ * ?>
+ * ```
+ * @param $selector
+ * @see Framework::seeElement()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeElement($selector) {
+ $this->scenario->assertion('seeElement', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if element does not exist (or is visible) on a page, matching it by CSS or XPath
+ *
+ * ``` php
+ * dontSeeElement('.error');
+ * $I->dontSeeElement(//form/input[1]);
+ * ?>
+ * ```
+ * @param $selector
+ * @see Framework::dontSeeElement()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeElement($selector) {
+ $this->scenario->action('dontSeeElement', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if option is selected in select field.
+ *
+ * ``` php
+ * seeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ * @return mixed
+ * @see Framework::seeOptionIsSelected()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeOptionIsSelected($select, $optionText) {
+ $this->scenario->assertion('seeOptionIsSelected', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks if option is not selected in select field.
+ *
+ * ``` php
+ * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa');
+ * ?>
+ * ```
+ *
+ * @param $selector
+ * @param $optionText
+ * @return mixed
+ * @see Framework::dontSeeOptionIsSelected()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function dontSeeOptionIsSelected($select, $optionText) {
+ $this->scenario->action('dontSeeOptionIsSelected', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Asserts that current page has 404 response status code.
+ * @see Framework::seePageNotFound()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seePageNotFound() {
+ $this->scenario->assertion('seePageNotFound', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+
+
+ /**
+ * Checks that response code is equal to value provided.
+ *
+ * @param $code
+ * @return mixed
+ * @see Framework::seeResponseCodeIs()
+ * @return \Codeception\Maybe
+ * ! This method is generated. DO NOT EDIT. !
+ * ! Documentation taken from corresponding module !
+ */
+ public function seeResponseCodeIs($code) {
+ $this->scenario->assertion('seeResponseCodeIs', func_get_args());
+ if ($this->scenario->running()) {
+ $result = $this->scenario->runStep();
+ return new Maybe($result);
+ }
+ return new Maybe();
+ }
+}
+
diff --git a/apps/basic/tests/functional/_bootstrap.php b/apps/basic/tests/functional/_bootstrap.php
new file mode 100644
index 0000000..7dfa7c3
--- /dev/null
+++ b/apps/basic/tests/functional/_bootstrap.php
@@ -0,0 +1,2 @@
+
+beginPage(); ?>
+
+
+
+
+ + This is the About page. You may modify the following file to customize its content: +
+ +
++ If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. +
+ ++ The above error occurred while the Web server was processing your request. +
++ Please contact us if you think this is a server error. Thank you. +
+ +You have successfully created your Yii-powered application.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.
+ + +Please fill out the following fields to login:
+ + 'login-form', + 'options' => array('class' => 'form-horizontal'), + 'fieldConfig' => array( + 'template' => "{label}\napp\models\User::$users
.
+ - This is the About page. You may modify the following file to customize its content: -
- -
-
diff --git a/apps/bootstrap/protected/views/site/contact.php b/apps/bootstrap/protected/views/site/contact.php
deleted file mode 100644
index bee1ede..0000000
--- a/apps/bootstrap/protected/views/site/contact.php
+++ /dev/null
@@ -1,46 +0,0 @@
-title = 'Contact';
-$this->params['breadcrumbs'][] = $this->title;
-?>
-- If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. -
- -beginWidget(ActiveForm::className(), array( - 'options' => array('class' => 'form-horizontal'), - 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), -)); ?> - field($model, 'name')->textInput(); ?> - field($model, 'email')->textInput(); ?> - field($model, 'subject')->textInput(); ?> - field($model, 'body')->textArea(array('rows' => 6)); ?> - field($model, 'verifyCode'); - echo $field->begin(); - echo $field->label(); - $this->widget(Captcha::className()); - echo Html::activeTextInput($model, 'verifyCode', array('class' => 'input-medium')); - echo $field->error(); - echo $field->end(); - ?> -Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus - commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
- Get started with Yii -Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris - condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. - Donec sed odio dui.
- - -Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris - condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. - Donec sed odio dui.
- - -Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta - felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum - massa.
- - -Please fill out the following fields to login:
- -beginWidget(ActiveForm::className(), array('options' => array('class' => 'form-horizontal'))); ?> - field($model, 'username')->textInput(); ?> - field($model, 'password')->passwordInput(); ?> - field($model, 'rememberMe')->checkbox(); ?> -Hello, !
+``` + +Instead of just scalar values you can pass anything else such as arrays or objects. + +Widgets +------- + +Widgets are a self-contained building blocks for your views. A widget may contain advanced logic, typically takes some +configuration and data and returns HTML. There is a good number of widgets bundled with Yii such as [active form](form.md), +breadcrumbs, menu or [wrappers around bootstrap component framework](boostrap-widgets.md). Additionally there are +extensions providing additional widgets such as official one for jQueryUI components. + +In order to use widget you need to do the following: + +```php +// Note that you have to "echo" the result to display it +echo \yii\widgets\Menu::widget(array('items' => $items)); + +// Passing an array to initialize the object properties +$form = \yii\widgets\ActiveForm::begin(array( + 'options' => array('class' => 'form-horizontal'), + 'fieldConfig' => array('inputOptions' => array('class' => 'input-xlarge')), +)); +... form inputs here ... +\yii\widgets\ActiveForm::end(); +``` + +In the code above `widget` method is used for a widget that just outputs content while `begin` and `end` are used for a +widget that wraps content between method calls with its own output. In case of the form this output is the `