├── .dockerignore ├── .env-dist ├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── CHANGELOG.md ├── Dockerfile ├── LICENSE ├── README.md ├── codeception.yml ├── composer.json ├── composer.lock ├── config ├── app.env-dist ├── common.php ├── console.php ├── env.php ├── main.php ├── web-dev.php └── web.php ├── docker-compose.dev.yml ├── docker-compose.yml ├── src ├── controllers │ └── SiteController.php └── views │ ├── layouts │ └── main.php │ └── site │ ├── error.php │ └── index.php ├── tests ├── .env-dist ├── codeception │ ├── _bootstrap.php │ ├── _config │ │ └── test.php │ ├── _support │ │ ├── FunctionalTester.php │ │ ├── Helper │ │ │ └── Unit.php │ │ ├── UnitTester.php │ │ └── _generated │ │ │ ├── FunctionalTesterActions.php │ │ │ └── UnitTesterActions.php │ ├── functional.suite.yml │ ├── functional │ │ ├── ErrorPageCept.php │ │ └── _bootstrap.php │ ├── unit.suite.yml │ └── unit │ │ ├── ApplicationTest.php │ │ └── _bootstrap.php └── docker-compose.test.yml ├── web ├── .htaccess └── index.php └── yii /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .vagrant 3 | .env 4 | 5 | data 6 | vendor 7 | 8 | runtime 9 | web/assets 10 | 11 | config/local.php -------------------------------------------------------------------------------- /.env-dist: -------------------------------------------------------------------------------- 1 | # Environment settings for docker-compose 2 | # ======================================= 3 | 4 | # docker-compose command 5 | # ---------------------- 6 | 7 | COMPOSE_PROJECT_NAME=yii2-app 8 | COMPOSE_FILE=./docker-compose.yml:./docker-compose.dev.yml 9 | 10 | 11 | # docker-compose.yml 12 | # ------------------ 13 | 14 | # Docker image to be build 15 | STACK_PHP_IMAGE=local/yii2-app 16 | 17 | # GitHub API token for container and build 18 | GITHUB_API_TOKEN=0000000000000000000000000000000000000000 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | vendor 3 | .env 4 | runtime 5 | web/assets 6 | docker-compose.override.yml 7 | app.env 8 | _artifacts 9 | tests/codeception/_output 10 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: docker 2 | 3 | services: 4 | - docker:dind 5 | 6 | stages: 7 | - build 8 | - test 9 | - release 10 | 11 | before_script: 12 | # TODO: only required on gitlab.com 13 | - (apk add --no-cache py-pip git && pip install docker-compose) || true 14 | 15 | - export ISOLATION=buildpipeline${CI_BUILD_PIPELINE} 16 | - export COMPOSE_PROJECT_NAME=${ISOLATION} 17 | - export APP_VERSION=$(git describe --always --dirty --tags) 18 | - export PHP_IMAGE_NAME=dmstr/yii2-app 19 | - export STACK_PHP_IMAGE=${PHP_IMAGE_NAME}:${APP_VERSION} 20 | - export REGISTRY_PHP_IMAGE=${PHP_IMAGE_NAME}:${CI_BUILD_REF_NAME} 21 | - docker info 22 | - docker version 23 | - docker-compose version 24 | - cp .env-dist .env 25 | - docker-compose build --pull 26 | 27 | after_script: 28 | - docker-compose down -v 29 | 30 | test: 31 | stage: test 32 | script: 33 | - cp config/app.env-dist config/app.env 34 | - cd tests 35 | - cp .env-dist .env 36 | - docker-compose run --entrypoint composer forrest --prefer-dist install 37 | - docker-compose run forrest run 38 | 39 | release:latest: 40 | stage: release 41 | script: 42 | - docker tag ${STACK_PHP_IMAGE} ${REGISTRY_PHP_IMAGE} 43 | - docker login --username ${REGISTRY_USERNAME} --password ${REGISTRY_PASSWORD} ${REGISTRY_HOST} 44 | - docker push ${REGISTRY_PHP_IMAGE} 45 | only: 46 | - latest 47 | - tags 48 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: php 4 | 5 | services: 6 | - docker 7 | 8 | before_install: 9 | - cp config/app.env-dist config/app.env 10 | - cp tests/.env-dist tests/.env 11 | - composer install --prefer-dist 12 | 13 | script: 14 | - cd tests 15 | - docker-compose run forrest run -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ### 0.6.0 4 | 5 | - Changed base image to [`yiisoftware/yii2-php:7.2-apache`](https://hub.docker.com/r/yiisoftware/yii2-php/) -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM yiisoftware/yii2-php:7.3-apache 2 | 3 | RUN a2enmod rewrite 4 | 5 | WORKDIR /app 6 | 7 | ADD composer.lock composer.json /app/ 8 | RUN composer install --prefer-dist --optimize-autoloader --no-dev && \ 9 | composer clear-cache 10 | 11 | ADD yii /app/ 12 | ADD ./web /app/web/ 13 | ADD ./src /app/src/ 14 | ADD ./config /app/config 15 | 16 | RUN cp config/app.env-dist config/app.env 17 | 18 | RUN mkdir -p runtime web/assets && \ 19 | chmod -R 775 runtime web/assets && \ 20 | chown -R www-data:www-data runtime web/assets 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, diemeisterei GmbH 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Docker Yii 2.0 Application 2 | ========================== 3 | 4 | :octocat: [`dmstr/docker-yii2-app`](https://github.com/dmstr/docker-yii2-app) 5 | :wolf: [`dmstr/docker-yii2-app`](https://git.hrzg.de/dmstr/docker-yii2-app/pipelines) 6 | :whale: [`dmstr/yii2-app`](https://hub.docker.com/r/dmstr/yii2-app/) 7 | :cd: [`dmstr/php-yii2`](https://hub.docker.com/r/dmstr/php-yii2/) 8 | 9 | [![Build Status](https://travis-ci.org/dmstr/docker-yii2-app.svg?branch=master)](https://travis-ci.org/dmstr/docker-yii2-app) 10 | 11 | ## Introduction 12 | 13 | This is a minimal dockerized application template for Yii 2.0 Framework in about 100 lines of code. 14 | 15 | 16 | ## Requirements 17 | 18 | - [Docker Toolbox](https://www.docker.com/products/docker-toolbox) 19 | - Docker `>=1.10` 20 | - docker-compose `>=1.7.0` 21 | 22 | 23 | ## Setup 24 | 25 | Prepare `docker-compose` environment 26 | 27 | cp .env-dist .env 28 | 29 | and application 30 | 31 | cp config/app.env-dist config/app.env 32 | mkdir web/assets 33 | 34 | Start stack 35 | 36 | docker-compose up -d 37 | 38 | Show containers 39 | 40 | docker-compose ps 41 | 42 | Run composer installation 43 | 44 | docker-compose run --rm php composer install 45 | 46 | 47 | ## Develop 48 | 49 | Create bash 50 | 51 | docker-compose exec php bash 52 | 53 | Run package update in container 54 | 55 | $ composer update -v 56 | 57 | ... 58 | 59 | $ yii help 60 | 61 | 62 | ## Test 63 | 64 | cd tests 65 | cp .env-dist .env 66 | 67 | Run tests in codeception (`forrest`) container 68 | d 69 | docker-compose run forrest run 70 | 71 | > :info: This is equivalent to `codecept run` inside the tester container 72 | 73 | 74 | ### CLI 75 | 76 | docker run dmstr/yii2-app yii 77 | 78 | 79 | ## Resources 80 | 81 | - [Changes](CHANGELOG.md) 82 | - [Yii 2.0 Framework guide](http://www.yiiframework.com/doc-2.0/guide-index.html) 83 | - [Yii 2.0 Docker Images](https://github.com/yiisoft/yii2-docker) 84 | - [Docker documentation](https://docs.docker.com) 85 | 86 | 87 | --- 88 | 89 | #### ![dmstr logo](http://t.phundament.com/dmstr-16-cropped.png) Built by [dmstr](http://diemeisterei.de) 90 | -------------------------------------------------------------------------------- /codeception.yml: -------------------------------------------------------------------------------- 1 | actor: Tester 2 | paths: 3 | tests: tests/codeception 4 | log: tests/codeception/_output 5 | data: tests/codeception/_data 6 | support: tests/codeception/_support 7 | envs: tests/codeception/_envs 8 | settings: 9 | bootstrap: _bootstrap.php 10 | colors: true 11 | memory_limit: 1024M 12 | extensions: 13 | enabled: 14 | - Codeception\Extension\RunFailed 15 | config: 16 | test_entry_url: http://web:80/index.php -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dmstr/yii2-app", 3 | "minimum-stability": "stable", 4 | "require": { 5 | "vlucas/phpdotenv": "2.*", 6 | "yiisoft/yii2": "^2.0.13", 7 | "yiisoft/yii2-bootstrap": "2.*", 8 | "yiisoft/yii2-debug": "2.*", 9 | "codemix/yii2-streamlog": "^1.0.0" 10 | }, 11 | "repositories": [ 12 | { 13 | "type": "composer", 14 | "url": "https://asset-packagist.org" 15 | } 16 | ], 17 | "config": { 18 | "fxp-asset": { 19 | "enabled": false, 20 | "vcs-driver-options": { 21 | "github-no-api": true 22 | }, 23 | "git-skip-update": "2 days", 24 | "pattern-skip-version": "(-build|-patch)", 25 | "optimize-with-installed-packages": false 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "b133215816a78cf0f43cdd7984377d0a", 8 | "packages": [ 9 | { 10 | "name": "bower-asset/bootstrap", 11 | "version": "v3.4.1", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/twbs/bootstrap.git", 15 | "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/twbs/bootstrap/zipball/68b0d231a13201eb14acd3dc84e51543d16e5f7e", 20 | "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e" 21 | }, 22 | "require": { 23 | "bower-asset/jquery": ">=1.9.1,<4.0" 24 | }, 25 | "type": "bower-asset", 26 | "license": [ 27 | "MIT" 28 | ] 29 | }, 30 | { 31 | "name": "bower-asset/inputmask", 32 | "version": "3.3.11", 33 | "source": { 34 | "type": "git", 35 | "url": "https://github.com/RobinHerbots/Inputmask.git", 36 | "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" 37 | }, 38 | "dist": { 39 | "type": "zip", 40 | "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5e670ad62f50c738388d4dcec78d2888505ad77b", 41 | "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" 42 | }, 43 | "require": { 44 | "bower-asset/jquery": ">=1.7" 45 | }, 46 | "type": "bower-asset", 47 | "license": [ 48 | "http://opensource.org/licenses/mit-license.php" 49 | ] 50 | }, 51 | { 52 | "name": "bower-asset/jquery", 53 | "version": "3.5.1", 54 | "source": { 55 | "type": "git", 56 | "url": "git@github.com:jquery/jquery-dist.git", 57 | "reference": "4c0e4becb8263bb5b3e6dadc448d8e7305ef8215" 58 | }, 59 | "dist": { 60 | "type": "zip", 61 | "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/4c0e4becb8263bb5b3e6dadc448d8e7305ef8215", 62 | "reference": "4c0e4becb8263bb5b3e6dadc448d8e7305ef8215" 63 | }, 64 | "type": "bower-asset", 65 | "license": [ 66 | "MIT" 67 | ] 68 | }, 69 | { 70 | "name": "bower-asset/punycode", 71 | "version": "v1.3.2", 72 | "source": { 73 | "type": "git", 74 | "url": "git@github.com:bestiejs/punycode.js.git", 75 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" 76 | }, 77 | "dist": { 78 | "type": "zip", 79 | "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", 80 | "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" 81 | }, 82 | "type": "bower-asset" 83 | }, 84 | { 85 | "name": "bower-asset/yii2-pjax", 86 | "version": "2.0.7.1", 87 | "source": { 88 | "type": "git", 89 | "url": "https://github.com/yiisoft/jquery-pjax.git", 90 | "reference": "aef7b953107264f00234902a3880eb50dafc48be" 91 | }, 92 | "dist": { 93 | "type": "zip", 94 | "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", 95 | "reference": "aef7b953107264f00234902a3880eb50dafc48be" 96 | }, 97 | "require": { 98 | "bower-asset/jquery": ">=1.8" 99 | }, 100 | "type": "bower-asset", 101 | "license": [ 102 | "MIT" 103 | ] 104 | }, 105 | { 106 | "name": "cebe/markdown", 107 | "version": "1.2.1", 108 | "source": { 109 | "type": "git", 110 | "url": "https://github.com/cebe/markdown.git", 111 | "reference": "9bac5e971dd391e2802dca5400bbeacbaea9eb86" 112 | }, 113 | "dist": { 114 | "type": "zip", 115 | "url": "https://api.github.com/repos/cebe/markdown/zipball/9bac5e971dd391e2802dca5400bbeacbaea9eb86", 116 | "reference": "9bac5e971dd391e2802dca5400bbeacbaea9eb86", 117 | "shasum": "" 118 | }, 119 | "require": { 120 | "lib-pcre": "*", 121 | "php": ">=5.4.0" 122 | }, 123 | "require-dev": { 124 | "cebe/indent": "*", 125 | "facebook/xhprof": "*@dev", 126 | "phpunit/phpunit": "4.1.*" 127 | }, 128 | "bin": [ 129 | "bin/markdown" 130 | ], 131 | "type": "library", 132 | "extra": { 133 | "branch-alias": { 134 | "dev-master": "1.2.x-dev" 135 | } 136 | }, 137 | "autoload": { 138 | "psr-4": { 139 | "cebe\\markdown\\": "" 140 | } 141 | }, 142 | "notification-url": "https://packagist.org/downloads/", 143 | "license": [ 144 | "MIT" 145 | ], 146 | "authors": [ 147 | { 148 | "name": "Carsten Brandt", 149 | "email": "mail@cebe.cc", 150 | "homepage": "http://cebe.cc/", 151 | "role": "Creator" 152 | } 153 | ], 154 | "description": "A super fast, highly extensible markdown parser for PHP", 155 | "homepage": "https://github.com/cebe/markdown#readme", 156 | "keywords": [ 157 | "extensible", 158 | "fast", 159 | "gfm", 160 | "markdown", 161 | "markdown-extra" 162 | ], 163 | "time": "2018-03-26T11:24:36+00:00" 164 | }, 165 | { 166 | "name": "codemix/yii2-streamlog", 167 | "version": "1.3.1", 168 | "source": { 169 | "type": "git", 170 | "url": "https://github.com/codemix/yii2-streamlog.git", 171 | "reference": "1ed104f4bc4e961d1d08fb92d6854f01b1bd0b80" 172 | }, 173 | "dist": { 174 | "type": "zip", 175 | "url": "https://api.github.com/repos/codemix/yii2-streamlog/zipball/1ed104f4bc4e961d1d08fb92d6854f01b1bd0b80", 176 | "reference": "1ed104f4bc4e961d1d08fb92d6854f01b1bd0b80", 177 | "shasum": "" 178 | }, 179 | "type": "library", 180 | "autoload": { 181 | "psr-4": { 182 | "codemix\\streamlog\\": "src/" 183 | } 184 | }, 185 | "notification-url": "https://packagist.org/downloads/", 186 | "license": [ 187 | "MIT" 188 | ], 189 | "authors": [ 190 | { 191 | "name": "Michael Härtl", 192 | "email": "haertl.mike@gmail.com" 193 | } 194 | ], 195 | "description": "A Yii 2 log target for streams in URL format", 196 | "keywords": [ 197 | "log", 198 | "stdout", 199 | "stream", 200 | "yii2" 201 | ], 202 | "time": "2020-03-26T13:23:28+00:00" 203 | }, 204 | { 205 | "name": "ezyang/htmlpurifier", 206 | "version": "v4.13.0", 207 | "source": { 208 | "type": "git", 209 | "url": "https://github.com/ezyang/htmlpurifier.git", 210 | "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75" 211 | }, 212 | "dist": { 213 | "type": "zip", 214 | "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75", 215 | "reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75", 216 | "shasum": "" 217 | }, 218 | "require": { 219 | "php": ">=5.2" 220 | }, 221 | "require-dev": { 222 | "simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd" 223 | }, 224 | "type": "library", 225 | "autoload": { 226 | "psr-0": { 227 | "HTMLPurifier": "library/" 228 | }, 229 | "files": [ 230 | "library/HTMLPurifier.composer.php" 231 | ], 232 | "exclude-from-classmap": [ 233 | "/library/HTMLPurifier/Language/" 234 | ] 235 | }, 236 | "notification-url": "https://packagist.org/downloads/", 237 | "license": [ 238 | "LGPL-2.1-or-later" 239 | ], 240 | "authors": [ 241 | { 242 | "name": "Edward Z. Yang", 243 | "email": "admin@htmlpurifier.org", 244 | "homepage": "http://ezyang.com" 245 | } 246 | ], 247 | "description": "Standards compliant HTML filter written in PHP", 248 | "homepage": "http://htmlpurifier.org/", 249 | "keywords": [ 250 | "html" 251 | ], 252 | "time": "2020-06-29T00:56:53+00:00" 253 | }, 254 | { 255 | "name": "opis/closure", 256 | "version": "3.5.4", 257 | "source": { 258 | "type": "git", 259 | "url": "https://github.com/opis/closure.git", 260 | "reference": "1d0deef692f66dae5d70663caee2867d0971306b" 261 | }, 262 | "dist": { 263 | "type": "zip", 264 | "url": "https://api.github.com/repos/opis/closure/zipball/1d0deef692f66dae5d70663caee2867d0971306b", 265 | "reference": "1d0deef692f66dae5d70663caee2867d0971306b", 266 | "shasum": "" 267 | }, 268 | "require": { 269 | "php": "^5.4 || ^7.0" 270 | }, 271 | "require-dev": { 272 | "jeremeamia/superclosure": "^2.0", 273 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 274 | }, 275 | "type": "library", 276 | "extra": { 277 | "branch-alias": { 278 | "dev-master": "3.5.x-dev" 279 | } 280 | }, 281 | "autoload": { 282 | "psr-4": { 283 | "Opis\\Closure\\": "src/" 284 | }, 285 | "files": [ 286 | "functions.php" 287 | ] 288 | }, 289 | "notification-url": "https://packagist.org/downloads/", 290 | "license": [ 291 | "MIT" 292 | ], 293 | "authors": [ 294 | { 295 | "name": "Marius Sarca", 296 | "email": "marius.sarca@gmail.com" 297 | }, 298 | { 299 | "name": "Sorin Sarca", 300 | "email": "sarca_sorin@hotmail.com" 301 | } 302 | ], 303 | "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", 304 | "homepage": "https://opis.io/closure", 305 | "keywords": [ 306 | "anonymous functions", 307 | "closure", 308 | "function", 309 | "serializable", 310 | "serialization", 311 | "serialize" 312 | ], 313 | "time": "2020-06-07T11:41:29+00:00" 314 | }, 315 | { 316 | "name": "symfony/polyfill-ctype", 317 | "version": "v1.17.0", 318 | "source": { 319 | "type": "git", 320 | "url": "https://github.com/symfony/polyfill-ctype.git", 321 | "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" 322 | }, 323 | "dist": { 324 | "type": "zip", 325 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", 326 | "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", 327 | "shasum": "" 328 | }, 329 | "require": { 330 | "php": ">=5.3.3" 331 | }, 332 | "suggest": { 333 | "ext-ctype": "For best performance" 334 | }, 335 | "type": "library", 336 | "extra": { 337 | "branch-alias": { 338 | "dev-master": "1.17-dev" 339 | } 340 | }, 341 | "autoload": { 342 | "psr-4": { 343 | "Symfony\\Polyfill\\Ctype\\": "" 344 | }, 345 | "files": [ 346 | "bootstrap.php" 347 | ] 348 | }, 349 | "notification-url": "https://packagist.org/downloads/", 350 | "license": [ 351 | "MIT" 352 | ], 353 | "authors": [ 354 | { 355 | "name": "Gert de Pagter", 356 | "email": "BackEndTea@gmail.com" 357 | }, 358 | { 359 | "name": "Symfony Community", 360 | "homepage": "https://symfony.com/contributors" 361 | } 362 | ], 363 | "description": "Symfony polyfill for ctype functions", 364 | "homepage": "https://symfony.com", 365 | "keywords": [ 366 | "compatibility", 367 | "ctype", 368 | "polyfill", 369 | "portable" 370 | ], 371 | "funding": [ 372 | { 373 | "url": "https://symfony.com/sponsor", 374 | "type": "custom" 375 | }, 376 | { 377 | "url": "https://github.com/fabpot", 378 | "type": "github" 379 | }, 380 | { 381 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 382 | "type": "tidelift" 383 | } 384 | ], 385 | "time": "2020-05-12T16:14:59+00:00" 386 | }, 387 | { 388 | "name": "vlucas/phpdotenv", 389 | "version": "v2.6.5", 390 | "source": { 391 | "type": "git", 392 | "url": "https://github.com/vlucas/phpdotenv.git", 393 | "reference": "2e977311ffb17b2f82028a9c36824647789c6365" 394 | }, 395 | "dist": { 396 | "type": "zip", 397 | "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2e977311ffb17b2f82028a9c36824647789c6365", 398 | "reference": "2e977311ffb17b2f82028a9c36824647789c6365", 399 | "shasum": "" 400 | }, 401 | "require": { 402 | "php": "^5.3.9 || ^7.0 || ^8.0", 403 | "symfony/polyfill-ctype": "^1.16" 404 | }, 405 | "require-dev": { 406 | "ext-filter": "*", 407 | "ext-pcre": "*", 408 | "phpunit/phpunit": "^4.8.35 || ^5.7.27" 409 | }, 410 | "suggest": { 411 | "ext-filter": "Required to use the boolean validator.", 412 | "ext-pcre": "Required to use most of the library." 413 | }, 414 | "type": "library", 415 | "extra": { 416 | "branch-alias": { 417 | "dev-master": "2.6-dev" 418 | } 419 | }, 420 | "autoload": { 421 | "psr-4": { 422 | "Dotenv\\": "src/" 423 | } 424 | }, 425 | "notification-url": "https://packagist.org/downloads/", 426 | "license": [ 427 | "BSD-3-Clause" 428 | ], 429 | "authors": [ 430 | { 431 | "name": "Graham Campbell", 432 | "email": "graham@alt-three.com", 433 | "homepage": "https://gjcampbell.co.uk/" 434 | }, 435 | { 436 | "name": "Vance Lucas", 437 | "email": "vance@vancelucas.com", 438 | "homepage": "https://vancelucas.com/" 439 | } 440 | ], 441 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 442 | "keywords": [ 443 | "dotenv", 444 | "env", 445 | "environment" 446 | ], 447 | "funding": [ 448 | { 449 | "url": "https://github.com/GrahamCampbell", 450 | "type": "github" 451 | }, 452 | { 453 | "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", 454 | "type": "tidelift" 455 | } 456 | ], 457 | "time": "2020-06-02T14:06:52+00:00" 458 | }, 459 | { 460 | "name": "yiisoft/yii2", 461 | "version": "2.0.38", 462 | "source": { 463 | "type": "git", 464 | "url": "https://github.com/yiisoft/yii2-framework.git", 465 | "reference": "fd01e747cc66a049ec105048f0ab8dfbdf60bf4b" 466 | }, 467 | "dist": { 468 | "type": "zip", 469 | "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/fd01e747cc66a049ec105048f0ab8dfbdf60bf4b", 470 | "reference": "fd01e747cc66a049ec105048f0ab8dfbdf60bf4b", 471 | "shasum": "" 472 | }, 473 | "require": { 474 | "bower-asset/inputmask": "~3.2.2 | ~3.3.5", 475 | "bower-asset/jquery": "3.5.*@stable | 3.4.*@stable | 3.3.*@stable | 3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", 476 | "bower-asset/punycode": "1.3.*", 477 | "bower-asset/yii2-pjax": "~2.0.1", 478 | "cebe/markdown": "~1.0.0 | ~1.1.0 | ~1.2.0", 479 | "ext-ctype": "*", 480 | "ext-mbstring": "*", 481 | "ezyang/htmlpurifier": "~4.6", 482 | "lib-pcre": "*", 483 | "php": ">=5.4.0", 484 | "yiisoft/yii2-composer": "~2.0.4" 485 | }, 486 | "bin": [ 487 | "yii" 488 | ], 489 | "type": "library", 490 | "extra": { 491 | "branch-alias": { 492 | "dev-master": "2.0.x-dev" 493 | } 494 | }, 495 | "autoload": { 496 | "psr-4": { 497 | "yii\\": "" 498 | } 499 | }, 500 | "notification-url": "https://packagist.org/downloads/", 501 | "license": [ 502 | "BSD-3-Clause" 503 | ], 504 | "authors": [ 505 | { 506 | "name": "Qiang Xue", 507 | "email": "qiang.xue@gmail.com", 508 | "homepage": "http://www.yiiframework.com/", 509 | "role": "Founder and project lead" 510 | }, 511 | { 512 | "name": "Alexander Makarov", 513 | "email": "sam@rmcreative.ru", 514 | "homepage": "http://rmcreative.ru/", 515 | "role": "Core framework development" 516 | }, 517 | { 518 | "name": "Maurizio Domba", 519 | "homepage": "http://mdomba.info/", 520 | "role": "Core framework development" 521 | }, 522 | { 523 | "name": "Carsten Brandt", 524 | "email": "mail@cebe.cc", 525 | "homepage": "http://cebe.cc/", 526 | "role": "Core framework development" 527 | }, 528 | { 529 | "name": "Timur Ruziev", 530 | "email": "resurtm@gmail.com", 531 | "homepage": "http://resurtm.com/", 532 | "role": "Core framework development" 533 | }, 534 | { 535 | "name": "Paul Klimov", 536 | "email": "klimov.paul@gmail.com", 537 | "role": "Core framework development" 538 | }, 539 | { 540 | "name": "Dmitry Naumenko", 541 | "email": "d.naumenko.a@gmail.com", 542 | "role": "Core framework development" 543 | }, 544 | { 545 | "name": "Boudewijn Vahrmeijer", 546 | "email": "info@dynasource.eu", 547 | "homepage": "http://dynasource.eu", 548 | "role": "Core framework development" 549 | } 550 | ], 551 | "description": "Yii PHP Framework Version 2", 552 | "homepage": "http://www.yiiframework.com/", 553 | "keywords": [ 554 | "framework", 555 | "yii2" 556 | ], 557 | "funding": [ 558 | { 559 | "url": "https://github.com/yiisoft", 560 | "type": "github" 561 | }, 562 | { 563 | "url": "https://opencollective.com/yiisoft", 564 | "type": "open_collective" 565 | }, 566 | { 567 | "url": "https://tidelift.com/funding/github/packagist/yiisoft/yii2", 568 | "type": "tidelift" 569 | } 570 | ], 571 | "time": "2020-09-14T21:52:10+00:00" 572 | }, 573 | { 574 | "name": "yiisoft/yii2-bootstrap", 575 | "version": "2.0.10", 576 | "source": { 577 | "type": "git", 578 | "url": "https://github.com/yiisoft/yii2-bootstrap.git", 579 | "reference": "073c9ab0a4eb71f2485d84c96a1967130300d8fc" 580 | }, 581 | "dist": { 582 | "type": "zip", 583 | "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/073c9ab0a4eb71f2485d84c96a1967130300d8fc", 584 | "reference": "073c9ab0a4eb71f2485d84c96a1967130300d8fc", 585 | "shasum": "" 586 | }, 587 | "require": { 588 | "bower-asset/bootstrap": "3.4.* | 3.3.* | 3.2.* | 3.1.*", 589 | "yiisoft/yii2": "~2.0.6" 590 | }, 591 | "require-dev": { 592 | "phpunit/phpunit": "<7" 593 | }, 594 | "type": "yii2-extension", 595 | "extra": { 596 | "branch-alias": { 597 | "dev-master": "2.0.x-dev" 598 | } 599 | }, 600 | "autoload": { 601 | "psr-4": { 602 | "yii\\bootstrap\\": "src" 603 | } 604 | }, 605 | "notification-url": "https://packagist.org/downloads/", 606 | "license": [ 607 | "BSD-3-Clause" 608 | ], 609 | "authors": [ 610 | { 611 | "name": "Paul Klimov", 612 | "email": "klimov.paul@gmail.com" 613 | }, 614 | { 615 | "name": "Alexander Makarov", 616 | "email": "sam@rmcreative.ru", 617 | "homepage": "http://rmcreative.ru/" 618 | }, 619 | { 620 | "name": "Antonio Ramirez", 621 | "email": "amigo.cobos@gmail.com" 622 | }, 623 | { 624 | "name": "Qiang Xue", 625 | "email": "qiang.xue@gmail.com", 626 | "homepage": "http://www.yiiframework.com/" 627 | } 628 | ], 629 | "description": "The Twitter Bootstrap extension for the Yii framework", 630 | "keywords": [ 631 | "bootstrap", 632 | "yii2" 633 | ], 634 | "time": "2019-04-23T13:18:43+00:00" 635 | }, 636 | { 637 | "name": "yiisoft/yii2-composer", 638 | "version": "2.0.10", 639 | "source": { 640 | "type": "git", 641 | "url": "https://github.com/yiisoft/yii2-composer.git", 642 | "reference": "94bb3f66e779e2774f8776d6e1bdeab402940510" 643 | }, 644 | "dist": { 645 | "type": "zip", 646 | "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/94bb3f66e779e2774f8776d6e1bdeab402940510", 647 | "reference": "94bb3f66e779e2774f8776d6e1bdeab402940510", 648 | "shasum": "" 649 | }, 650 | "require": { 651 | "composer-plugin-api": "^1.0 | ^2.0" 652 | }, 653 | "require-dev": { 654 | "composer/composer": "^1.0 | ^2.0@dev", 655 | "phpunit/phpunit": "<7" 656 | }, 657 | "type": "composer-plugin", 658 | "extra": { 659 | "class": "yii\\composer\\Plugin", 660 | "branch-alias": { 661 | "dev-master": "2.0.x-dev" 662 | } 663 | }, 664 | "autoload": { 665 | "psr-4": { 666 | "yii\\composer\\": "" 667 | } 668 | }, 669 | "notification-url": "https://packagist.org/downloads/", 670 | "license": [ 671 | "BSD-3-Clause" 672 | ], 673 | "authors": [ 674 | { 675 | "name": "Qiang Xue", 676 | "email": "qiang.xue@gmail.com" 677 | }, 678 | { 679 | "name": "Carsten Brandt", 680 | "email": "mail@cebe.cc" 681 | } 682 | ], 683 | "description": "The composer plugin for Yii extension installer", 684 | "keywords": [ 685 | "composer", 686 | "extension installer", 687 | "yii2" 688 | ], 689 | "funding": [ 690 | { 691 | "url": "https://github.com/yiisoft", 692 | "type": "github" 693 | }, 694 | { 695 | "url": "https://opencollective.com/yiisoft", 696 | "type": "open_collective" 697 | }, 698 | { 699 | "url": "https://tidelift.com/funding/github/packagist/yiisoft/yii2-composer", 700 | "type": "tidelift" 701 | } 702 | ], 703 | "time": "2020-06-24T00:04:01+00:00" 704 | }, 705 | { 706 | "name": "yiisoft/yii2-debug", 707 | "version": "2.1.13", 708 | "source": { 709 | "type": "git", 710 | "url": "https://github.com/yiisoft/yii2-debug.git", 711 | "reference": "696712a2a3565b1a072ad3c9d298e262967e8282" 712 | }, 713 | "dist": { 714 | "type": "zip", 715 | "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/696712a2a3565b1a072ad3c9d298e262967e8282", 716 | "reference": "696712a2a3565b1a072ad3c9d298e262967e8282", 717 | "shasum": "" 718 | }, 719 | "require": { 720 | "ext-mbstring": "*", 721 | "opis/closure": "^3.3", 722 | "php": ">=5.4", 723 | "yiisoft/yii2": "~2.0.13" 724 | }, 725 | "require-dev": { 726 | "phpunit/phpunit": "<7", 727 | "yiisoft/yii2-coding-standards": "~2.0", 728 | "yiisoft/yii2-swiftmailer": "*" 729 | }, 730 | "type": "yii2-extension", 731 | "extra": { 732 | "branch-alias": { 733 | "dev-master": "2.0.x-dev" 734 | } 735 | }, 736 | "autoload": { 737 | "psr-4": { 738 | "yii\\debug\\": "src" 739 | } 740 | }, 741 | "notification-url": "https://packagist.org/downloads/", 742 | "license": [ 743 | "BSD-3-Clause" 744 | ], 745 | "authors": [ 746 | { 747 | "name": "Qiang Xue", 748 | "email": "qiang.xue@gmail.com" 749 | }, 750 | { 751 | "name": "Simon Karlen", 752 | "email": "simi.albi@outlook.com" 753 | } 754 | ], 755 | "description": "The debugger extension for the Yii framework", 756 | "keywords": [ 757 | "debug", 758 | "debugger", 759 | "yii2" 760 | ], 761 | "time": "2020-01-17T13:40:32+00:00" 762 | } 763 | ], 764 | "packages-dev": [], 765 | "aliases": [], 766 | "minimum-stability": "stable", 767 | "stability-flags": [], 768 | "prefer-stable": false, 769 | "prefer-lowest": false, 770 | "platform": [], 771 | "platform-dev": [], 772 | "plugin-api-version": "1.1.0" 773 | } 774 | -------------------------------------------------------------------------------- /config/app.env-dist: -------------------------------------------------------------------------------- 1 | YII_ENV=prod 2 | YII_DEBUG=0 3 | YII_TRACE_LEVEL=0 4 | 5 | APP_NAME=yii2-app 6 | APP_TITLE="Docker Yii 2.0 Application" 7 | APP_ADMIN_EMAIL=${APP_NAME}@example.com 8 | APP_COOKIE_VALIDATION_KEY= 9 | APP_PRETTY_URLS=1 10 | APP_CONFIG_FILE=/app/src/config/local.php -------------------------------------------------------------------------------- /config/common.php: -------------------------------------------------------------------------------- 1 | 'app', 15 | 'language' => 'en', 16 | 'basePath' => dirname(__DIR__).'/src', 17 | 'vendorPath' => '@app/../vendor', 18 | 'runtimePath' => '@app/../runtime', 19 | 'aliases' => [ 20 | '@bower' => '@vendor/bower-asset', 21 | '@npm' => '@vendor/npm-asset', 22 | ], 23 | // Bootstrapped modules are loaded in every request 24 | 'bootstrap' => [ 25 | 'log', 26 | ], 27 | ]; 28 | -------------------------------------------------------------------------------- /config/console.php: -------------------------------------------------------------------------------- 1 | 'app\commands', 14 | ]; 15 | -------------------------------------------------------------------------------- /config/env.php: -------------------------------------------------------------------------------- 1 | load(); 19 | 20 | // Checks & validation 21 | $dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]); 22 | $dotenv->required('YII_ENV', ['dev', 'prod', 'test']); 23 | $dotenv->required([ 24 | 'YII_TRACE_LEVEL', 25 | 'APP_NAME', 26 | 'APP_COOKIE_VALIDATION_KEY', 27 | ]); 28 | 29 | // Additional Validations 30 | if (!preg_match('/^[a-z0-9_-]{3,16}$/', getenv('APP_NAME'))) { 31 | throw new \Dotenv\Exception\ValidationException( 32 | 'APP_NAME must only be lowercase, dash or underscore and 3-16 characters long.' 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /config/main.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'debug', 16 | ], 17 | 'modules' => [ 18 | 'debug' => [ 19 | 'class' => 'yii\debug\Module', 20 | 'allowedIPs' => [ 21 | '127.0.0.1', 22 | '::1', 23 | '192.168.*', 24 | '172.18.*', 25 | ], 26 | ], 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /config/web.php: -------------------------------------------------------------------------------- 1 | [ 15 | 'errorHandler' => [ 16 | 'errorAction' => 'site/error', 17 | ], 18 | 'log' => [ 19 | 'targets' => [ 20 | // writes to php-fpm output stream 21 | [ 22 | 'class' => 'codemix\streamlog\Target', 23 | 'url' => 'php://stdout', 24 | 'levels' => ['info', 'trace'], 25 | 'logVars' => [], 26 | 'enabled' => YII_DEBUG, 27 | ], 28 | [ 29 | 'class' => 'codemix\streamlog\Target', 30 | 'url' => 'php://stderr', 31 | 'levels' => ['error', 'warning'], 32 | 'logVars' => [], 33 | ], 34 | ], 35 | ], 36 | 'request' => [ 37 | 'cookieValidationKey' => getenv('APP_COOKIE_VALIDATION_KEY'), 38 | ], 39 | 'urlManager' => [ 40 | 'enablePrettyUrl' => getenv('APP_PRETTY_URLS') 41 | ] 42 | ], 43 | ]; 44 | -------------------------------------------------------------------------------- /docker-compose.dev.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | php: 4 | build: . 5 | environment: 6 | - GITHUB_API_TOKEN 7 | volumes: 8 | - ./composer.json:/app/composer.json 9 | - ./composer.lock:/app/composer.lock 10 | - ./vendor:/app/vendor 11 | - ./config:/app/config 12 | - ./src:/app/src 13 | - ./web:/app/web 14 | - ./tests:/app/tests 15 | - ./codeception.yml:/app/codeception.yml 16 | # composer-cache on host-volume 17 | - ~/.composer-docker/cache:/root/.composer/cache 18 | ports: 19 | - 20080:80 20 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | php: 4 | image: ${STACK_PHP_IMAGE} 5 | -------------------------------------------------------------------------------- /src/controllers/SiteController.php: -------------------------------------------------------------------------------- 1 | [ 28 | 'class' => 'yii\web\ErrorAction', 29 | ], 30 | ]; 31 | } 32 | 33 | /** 34 | * Renders the start page. 35 | * 36 | * @return string 37 | */ 38 | public function actionIndex() 39 | { 40 | return $this->render('index'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/views/layouts/main.php: -------------------------------------------------------------------------------- 1 | title = $this->title; 17 | 18 | // Register asset bundle 19 | \yii\bootstrap\BootstrapAsset::register($this); 20 | 21 | ?> 22 | 23 | beginPage() ?> 24 | 25 | 26 | 27 | 28 | 29 | 30 | <?= Html::encode($this->title) ?> 31 | head() ?> 32 | 33 | 34 | beginBody() ?> 35 | 36 |
37 | 38 |
39 | 40 | 55 | 56 | endBody() ?> 57 | 58 | 59 | endPage() ?> 60 | -------------------------------------------------------------------------------- /src/views/site/error.php: -------------------------------------------------------------------------------- 1 | title = $name; 19 | ?> 20 |
21 | 22 |

title) ?>

23 | 24 |
25 | 26 |
27 | 28 |

29 | The above error occurred while the Web server was processing your request. 30 |

31 |

32 | Please contact us if you think this is a server error. Thank you. 33 |

34 | 35 |

36 | homeUrl) ?> 37 |

38 | 39 |
40 | -------------------------------------------------------------------------------- /src/views/site/index.php: -------------------------------------------------------------------------------- 1 | title .= 'Home'; 14 | ?> 15 | 16 |
17 | 18 |
19 |
20 |

21 |

22 | '_blank', 27 | 'class' => 'btn btn-primary' 28 | ]) ?> 29 | 30 |

31 |
32 |
33 |
34 |

Start development bash

35 |

36 | 37 | docker-compose run --rm php bash 38 | 39 |

40 |

Install packages

41 |

42 | 43 | $ composer require "dmstr/yii2-adminlte-asset" 44 | 45 |

46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /tests/.env-dist: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=test-yii2-app 2 | COMPOSE_FILE=../docker-compose.yml:./docker-compose.test.yml 3 | 4 | STACK_PHP_IMAGE=local/yii2-app 5 | -------------------------------------------------------------------------------- /tests/codeception/_bootstrap.php: -------------------------------------------------------------------------------- 1 | [ 21 | 'request' => [ 22 | 'cookieValidationKey' => 'FUNCTIONAL_TESTING' 23 | ], 24 | ] 25 | ] 26 | ); -------------------------------------------------------------------------------- /tests/codeception/_support/FunctionalTester.php: -------------------------------------------------------------------------------- 1 | getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args())); 30 | } 31 | 32 | 33 | /** 34 | * [!] Method is generated. Documentation taken from corresponding module. 35 | * 36 | * Opens a file and stores it's content. 37 | * 38 | * Usage: 39 | * 40 | * ``` php 41 | * openFile('composer.json'); 43 | * $I->seeInThisFile('codeception/codeception'); 44 | * ?> 45 | * ``` 46 | * 47 | * @param $filename 48 | * @see \Codeception\Module\Filesystem::openFile() 49 | */ 50 | public function openFile($filename) { 51 | return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args())); 52 | } 53 | 54 | 55 | /** 56 | * [!] Method is generated. Documentation taken from corresponding module. 57 | * 58 | * Deletes a file 59 | * 60 | * ``` php 61 | * deleteFile('composer.lock'); 63 | * ?> 64 | * ``` 65 | * 66 | * @param $filename 67 | * @see \Codeception\Module\Filesystem::deleteFile() 68 | */ 69 | public function deleteFile($filename) { 70 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args())); 71 | } 72 | 73 | 74 | /** 75 | * [!] Method is generated. Documentation taken from corresponding module. 76 | * 77 | * Deletes directory with all subdirectories 78 | * 79 | * ``` php 80 | * deleteDir('vendor'); 82 | * ?> 83 | * ``` 84 | * 85 | * @param $dirname 86 | * @see \Codeception\Module\Filesystem::deleteDir() 87 | */ 88 | public function deleteDir($dirname) { 89 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args())); 90 | } 91 | 92 | 93 | /** 94 | * [!] Method is generated. Documentation taken from corresponding module. 95 | * 96 | * Copies directory with all contents 97 | * 98 | * ``` php 99 | * copyDir('vendor','old_vendor'); 101 | * ?> 102 | * ``` 103 | * 104 | * @param $src 105 | * @param $dst 106 | * @see \Codeception\Module\Filesystem::copyDir() 107 | */ 108 | public function copyDir($src, $dst) { 109 | return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args())); 110 | } 111 | 112 | 113 | /** 114 | * [!] Method is generated. Documentation taken from corresponding module. 115 | * 116 | * Checks If opened file has `text` in it. 117 | * 118 | * Usage: 119 | * 120 | * ``` php 121 | * openFile('composer.json'); 123 | * $I->seeInThisFile('codeception/codeception'); 124 | * ?> 125 | * ``` 126 | * 127 | * @param $text 128 | * Conditional Assertion: Test won't be stopped on fail 129 | * @see \Codeception\Module\Filesystem::seeInThisFile() 130 | */ 131 | public function canSeeInThisFile($text) { 132 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args())); 133 | } 134 | /** 135 | * [!] Method is generated. Documentation taken from corresponding module. 136 | * 137 | * Checks If opened file has `text` in it. 138 | * 139 | * Usage: 140 | * 141 | * ``` php 142 | * openFile('composer.json'); 144 | * $I->seeInThisFile('codeception/codeception'); 145 | * ?> 146 | * ``` 147 | * 148 | * @param $text 149 | * @see \Codeception\Module\Filesystem::seeInThisFile() 150 | */ 151 | public function seeInThisFile($text) { 152 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args())); 153 | } 154 | 155 | 156 | /** 157 | * [!] Method is generated. Documentation taken from corresponding module. 158 | * 159 | * Checks If opened file has the `number` of new lines. 160 | * 161 | * Usage: 162 | * 163 | * ``` php 164 | * openFile('composer.json'); 166 | * $I->seeNumberNewLines(5); 167 | * ?> 168 | * ``` 169 | * 170 | * @param int $number New lines 171 | * Conditional Assertion: Test won't be stopped on fail 172 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() 173 | */ 174 | public function canSeeNumberNewLines($number) { 175 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args())); 176 | } 177 | /** 178 | * [!] Method is generated. Documentation taken from corresponding module. 179 | * 180 | * Checks If opened file has the `number` of new lines. 181 | * 182 | * Usage: 183 | * 184 | * ``` php 185 | * openFile('composer.json'); 187 | * $I->seeNumberNewLines(5); 188 | * ?> 189 | * ``` 190 | * 191 | * @param int $number New lines 192 | * @see \Codeception\Module\Filesystem::seeNumberNewLines() 193 | */ 194 | public function seeNumberNewLines($number) { 195 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args())); 196 | } 197 | 198 | 199 | /** 200 | * [!] Method is generated. Documentation taken from corresponding module. 201 | * 202 | * Checks that contents of currently opened file matches $regex 203 | * 204 | * @param $regex 205 | * Conditional Assertion: Test won't be stopped on fail 206 | * @see \Codeception\Module\Filesystem::seeThisFileMatches() 207 | */ 208 | public function canSeeThisFileMatches($regex) { 209 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeThisFileMatches', func_get_args())); 210 | } 211 | /** 212 | * [!] Method is generated. Documentation taken from corresponding module. 213 | * 214 | * Checks that contents of currently opened file matches $regex 215 | * 216 | * @param $regex 217 | * @see \Codeception\Module\Filesystem::seeThisFileMatches() 218 | */ 219 | public function seeThisFileMatches($regex) { 220 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeThisFileMatches', func_get_args())); 221 | } 222 | 223 | 224 | /** 225 | * [!] Method is generated. Documentation taken from corresponding module. 226 | * 227 | * Checks the strict matching of file contents. 228 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. 229 | * Better to use with HEREDOC strings. 230 | * Matching is done after removing "\r" chars from file content. 231 | * 232 | * ``` php 233 | * openFile('process.pid'); 235 | * $I->seeFileContentsEqual('3192'); 236 | * ?> 237 | * ``` 238 | * 239 | * @param $text 240 | * Conditional Assertion: Test won't be stopped on fail 241 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 242 | */ 243 | public function canSeeFileContentsEqual($text) { 244 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args())); 245 | } 246 | /** 247 | * [!] Method is generated. Documentation taken from corresponding module. 248 | * 249 | * Checks the strict matching of file contents. 250 | * Unlike `seeInThisFile` will fail if file has something more than expected lines. 251 | * Better to use with HEREDOC strings. 252 | * Matching is done after removing "\r" chars from file content. 253 | * 254 | * ``` php 255 | * openFile('process.pid'); 257 | * $I->seeFileContentsEqual('3192'); 258 | * ?> 259 | * ``` 260 | * 261 | * @param $text 262 | * @see \Codeception\Module\Filesystem::seeFileContentsEqual() 263 | */ 264 | public function seeFileContentsEqual($text) { 265 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args())); 266 | } 267 | 268 | 269 | /** 270 | * [!] Method is generated. Documentation taken from corresponding module. 271 | * 272 | * Checks If opened file doesn't contain `text` in it 273 | * 274 | * ``` php 275 | * openFile('composer.json'); 277 | * $I->dontSeeInThisFile('codeception/codeception'); 278 | * ?> 279 | * ``` 280 | * 281 | * @param $text 282 | * Conditional Assertion: Test won't be stopped on fail 283 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 284 | */ 285 | public function cantSeeInThisFile($text) { 286 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args())); 287 | } 288 | /** 289 | * [!] Method is generated. Documentation taken from corresponding module. 290 | * 291 | * Checks If opened file doesn't contain `text` in it 292 | * 293 | * ``` php 294 | * openFile('composer.json'); 296 | * $I->dontSeeInThisFile('codeception/codeception'); 297 | * ?> 298 | * ``` 299 | * 300 | * @param $text 301 | * @see \Codeception\Module\Filesystem::dontSeeInThisFile() 302 | */ 303 | public function dontSeeInThisFile($text) { 304 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args())); 305 | } 306 | 307 | 308 | /** 309 | * [!] Method is generated. Documentation taken from corresponding module. 310 | * 311 | * Deletes a file 312 | * @see \Codeception\Module\Filesystem::deleteThisFile() 313 | */ 314 | public function deleteThisFile() { 315 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args())); 316 | } 317 | 318 | 319 | /** 320 | * [!] Method is generated. Documentation taken from corresponding module. 321 | * 322 | * Checks if file exists in path. 323 | * Opens a file when it's exists 324 | * 325 | * ``` php 326 | * seeFileFound('UserModel.php','app/models'); 328 | * ?> 329 | * ``` 330 | * 331 | * @param $filename 332 | * @param string $path 333 | * Conditional Assertion: Test won't be stopped on fail 334 | * @see \Codeception\Module\Filesystem::seeFileFound() 335 | */ 336 | public function canSeeFileFound($filename, $path = null) { 337 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args())); 338 | } 339 | /** 340 | * [!] Method is generated. Documentation taken from corresponding module. 341 | * 342 | * Checks if file exists in path. 343 | * Opens a file when it's exists 344 | * 345 | * ``` php 346 | * seeFileFound('UserModel.php','app/models'); 348 | * ?> 349 | * ``` 350 | * 351 | * @param $filename 352 | * @param string $path 353 | * @see \Codeception\Module\Filesystem::seeFileFound() 354 | */ 355 | public function seeFileFound($filename, $path = null) { 356 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args())); 357 | } 358 | 359 | 360 | /** 361 | * [!] Method is generated. Documentation taken from corresponding module. 362 | * 363 | * Checks if file does not exist in path 364 | * 365 | * @param $filename 366 | * @param string $path 367 | * Conditional Assertion: Test won't be stopped on fail 368 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 369 | */ 370 | public function cantSeeFileFound($filename, $path = null) { 371 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args())); 372 | } 373 | /** 374 | * [!] Method is generated. Documentation taken from corresponding module. 375 | * 376 | * Checks if file does not exist in path 377 | * 378 | * @param $filename 379 | * @param string $path 380 | * @see \Codeception\Module\Filesystem::dontSeeFileFound() 381 | */ 382 | public function dontSeeFileFound($filename, $path = null) { 383 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args())); 384 | } 385 | 386 | 387 | /** 388 | * [!] Method is generated. Documentation taken from corresponding module. 389 | * 390 | * Erases directory contents 391 | * 392 | * ``` php 393 | * cleanDir('logs'); 395 | * ?> 396 | * ``` 397 | * 398 | * @param $dirname 399 | * @see \Codeception\Module\Filesystem::cleanDir() 400 | */ 401 | public function cleanDir($dirname) { 402 | return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args())); 403 | } 404 | 405 | 406 | /** 407 | * [!] Method is generated. Documentation taken from corresponding module. 408 | * 409 | * Saves contents to file 410 | * 411 | * @param $filename 412 | * @param $contents 413 | * @see \Codeception\Module\Filesystem::writeToFile() 414 | */ 415 | public function writeToFile($filename, $contents) { 416 | return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args())); 417 | } 418 | 419 | 420 | /** 421 | * [!] Method is generated. Documentation taken from corresponding module. 422 | * 423 | * Authorizes user on a site without submitting login form. 424 | * Use it for fast pragmatic authorization in functional tests. 425 | * 426 | * ```php 427 | * amLoggedInAs(1); 430 | * 431 | * // User object is passed as parameter 432 | * $admin = \app\models\User::findByUsername('admin'); 433 | * $I->amLoggedInAs($admin); 434 | * ``` 435 | * Requires `user` component to be enabled and configured. 436 | * 437 | * @param $user 438 | * @throws ModuleException 439 | * @see \Codeception\Module\Yii2::amLoggedInAs() 440 | */ 441 | public function amLoggedInAs($user) { 442 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amLoggedInAs', func_get_args())); 443 | } 444 | 445 | 446 | /** 447 | * [!] Method is generated. Documentation taken from corresponding module. 448 | * 449 | * Creates and loads fixtures from a config. 450 | * Signature is the same as for `fixtures()` method of `yii\test\FixtureTrait` 451 | * 452 | * ```php 453 | * haveFixtures([ 455 | * 'posts' => PostsFixture::className(), 456 | * 'user' => [ 457 | * 'class' => UserFixture::className(), 458 | * 'dataFile' => '@tests/_data/models/user.php', 459 | * ], 460 | * ]); 461 | * ``` 462 | * 463 | * @param $fixtures 464 | * @part fixtures 465 | * @see \Codeception\Module\Yii2::haveFixtures() 466 | */ 467 | public function haveFixtures($fixtures) { 468 | return $this->getScenario()->runStep(new \Codeception\Step\Action('haveFixtures', func_get_args())); 469 | } 470 | 471 | 472 | /** 473 | * [!] Method is generated. Documentation taken from corresponding module. 474 | * 475 | * Returns all loaded fixtures. 476 | * Array of fixture instances 477 | * 478 | * @part fixtures 479 | * @return array 480 | * @see \Codeception\Module\Yii2::grabFixtures() 481 | */ 482 | public function grabFixtures() { 483 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFixtures', func_get_args())); 484 | } 485 | 486 | 487 | /** 488 | * [!] Method is generated. Documentation taken from corresponding module. 489 | * 490 | * Gets a fixture by name. 491 | * Returns a Fixture instance. If a fixture is an instance of `\yii\test\BaseActiveFixture` a second parameter 492 | * can be used to return a specific model: 493 | * 494 | * ```php 495 | * haveFixtures(['users' => UserFixture::className()]); 497 | * 498 | * $users = $I->grabFixture('users'); 499 | * 500 | * // get first user by key, if a fixture is instance of ActiveFixture 501 | * $user = $I->grabFixture('users', 'user1'); 502 | * ``` 503 | * 504 | * @param $name 505 | * @return mixed 506 | * @throws ModuleException if a fixture is not found 507 | * @part fixtures 508 | * @see \Codeception\Module\Yii2::grabFixture() 509 | */ 510 | public function grabFixture($name, $index = null) { 511 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFixture', func_get_args())); 512 | } 513 | 514 | 515 | /** 516 | * [!] Method is generated. Documentation taken from corresponding module. 517 | * 518 | * Inserts record into the database. 519 | * 520 | * ``` php 521 | * haveRecord('app\models\User', array('name' => 'Davert')); 523 | * ?> 524 | * ``` 525 | * 526 | * @param $model 527 | * @param array $attributes 528 | * @return mixed 529 | * @part orm 530 | * @see \Codeception\Module\Yii2::haveRecord() 531 | */ 532 | public function haveRecord($model, $attributes = null) { 533 | return $this->getScenario()->runStep(new \Codeception\Step\Action('haveRecord', func_get_args())); 534 | } 535 | 536 | 537 | /** 538 | * [!] Method is generated. Documentation taken from corresponding module. 539 | * 540 | * Checks that record exists in database. 541 | * 542 | * ``` php 543 | * $I->seeRecord('app\models\User', array('name' => 'davert')); 544 | * ``` 545 | * 546 | * @param $model 547 | * @param array $attributes 548 | * @part orm 549 | * Conditional Assertion: Test won't be stopped on fail 550 | * @see \Codeception\Module\Yii2::seeRecord() 551 | */ 552 | public function canSeeRecord($model, $attributes = null) { 553 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeRecord', func_get_args())); 554 | } 555 | /** 556 | * [!] Method is generated. Documentation taken from corresponding module. 557 | * 558 | * Checks that record exists in database. 559 | * 560 | * ``` php 561 | * $I->seeRecord('app\models\User', array('name' => 'davert')); 562 | * ``` 563 | * 564 | * @param $model 565 | * @param array $attributes 566 | * @part orm 567 | * @see \Codeception\Module\Yii2::seeRecord() 568 | */ 569 | public function seeRecord($model, $attributes = null) { 570 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeRecord', func_get_args())); 571 | } 572 | 573 | 574 | /** 575 | * [!] Method is generated. Documentation taken from corresponding module. 576 | * 577 | * Checks that record does not exist in database. 578 | * 579 | * ``` php 580 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); 581 | * ``` 582 | * 583 | * @param $model 584 | * @param array $attributes 585 | * @part orm 586 | * Conditional Assertion: Test won't be stopped on fail 587 | * @see \Codeception\Module\Yii2::dontSeeRecord() 588 | */ 589 | public function cantSeeRecord($model, $attributes = null) { 590 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeRecord', func_get_args())); 591 | } 592 | /** 593 | * [!] Method is generated. Documentation taken from corresponding module. 594 | * 595 | * Checks that record does not exist in database. 596 | * 597 | * ``` php 598 | * $I->dontSeeRecord('app\models\User', array('name' => 'davert')); 599 | * ``` 600 | * 601 | * @param $model 602 | * @param array $attributes 603 | * @part orm 604 | * @see \Codeception\Module\Yii2::dontSeeRecord() 605 | */ 606 | public function dontSeeRecord($model, $attributes = null) { 607 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeRecord', func_get_args())); 608 | } 609 | 610 | 611 | /** 612 | * [!] Method is generated. Documentation taken from corresponding module. 613 | * 614 | * Retrieves record from database 615 | * 616 | * ``` php 617 | * $category = $I->grabRecord('app\models\User', array('name' => 'davert')); 618 | * ``` 619 | * 620 | * @param $model 621 | * @param array $attributes 622 | * @return mixed 623 | * @part orm 624 | * @see \Codeception\Module\Yii2::grabRecord() 625 | */ 626 | public function grabRecord($model, $attributes = null) { 627 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabRecord', func_get_args())); 628 | } 629 | 630 | 631 | /** 632 | * [!] Method is generated. Documentation taken from corresponding module. 633 | * 634 | * Similar to amOnPage but accepts route as first argument and params as second 635 | * 636 | * ``` 637 | * $I->amOnRoute('site/view', ['page' => 'about']); 638 | * ``` 639 | * 640 | * @see \Codeception\Module\Yii2::amOnRoute() 641 | */ 642 | public function amOnRoute($route, $params = null) { 643 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnRoute', func_get_args())); 644 | } 645 | 646 | 647 | /** 648 | * [!] Method is generated. Documentation taken from corresponding module. 649 | * 650 | * Gets a component from Yii container. Throws exception if component is not available 651 | * 652 | * ```php 653 | * grabComponent('mailer'); 655 | * ``` 656 | * 657 | * @param $component 658 | * @return mixed 659 | * @throws ModuleException 660 | * @see \Codeception\Module\Yii2::grabComponent() 661 | */ 662 | public function grabComponent($component) { 663 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabComponent', func_get_args())); 664 | } 665 | 666 | 667 | /** 668 | * [!] Method is generated. Documentation taken from corresponding module. 669 | * 670 | * Checks that email is sent. 671 | * 672 | * ```php 673 | * seeEmailIsSent(); 676 | * 677 | * // check that only 3 emails were sent 678 | * $I->seeEmailIsSent(3); 679 | * ``` 680 | * 681 | * @param int $num 682 | * @throws ModuleException 683 | * @part email 684 | * Conditional Assertion: Test won't be stopped on fail 685 | * @see \Codeception\Module\Yii2::seeEmailIsSent() 686 | */ 687 | public function canSeeEmailIsSent($num = null) { 688 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeEmailIsSent', func_get_args())); 689 | } 690 | /** 691 | * [!] Method is generated. Documentation taken from corresponding module. 692 | * 693 | * Checks that email is sent. 694 | * 695 | * ```php 696 | * seeEmailIsSent(); 699 | * 700 | * // check that only 3 emails were sent 701 | * $I->seeEmailIsSent(3); 702 | * ``` 703 | * 704 | * @param int $num 705 | * @throws ModuleException 706 | * @part email 707 | * @see \Codeception\Module\Yii2::seeEmailIsSent() 708 | */ 709 | public function seeEmailIsSent($num = null) { 710 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeEmailIsSent', func_get_args())); 711 | } 712 | 713 | 714 | /** 715 | * [!] Method is generated. Documentation taken from corresponding module. 716 | * 717 | * Checks that no email was sent 718 | * 719 | * @part email 720 | * Conditional Assertion: Test won't be stopped on fail 721 | * @see \Codeception\Module\Yii2::dontSeeEmailIsSent() 722 | */ 723 | public function cantSeeEmailIsSent() { 724 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeEmailIsSent', func_get_args())); 725 | } 726 | /** 727 | * [!] Method is generated. Documentation taken from corresponding module. 728 | * 729 | * Checks that no email was sent 730 | * 731 | * @part email 732 | * @see \Codeception\Module\Yii2::dontSeeEmailIsSent() 733 | */ 734 | public function dontSeeEmailIsSent() { 735 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeEmailIsSent', func_get_args())); 736 | } 737 | 738 | 739 | /** 740 | * [!] Method is generated. Documentation taken from corresponding module. 741 | * 742 | * Returns array of all sent email messages. 743 | * Each message implements `yii\mail\Message` interface. 744 | * Useful to perform additional checks using `Asserts` module: 745 | * 746 | * ```php 747 | * seeEmailIsSent(); 749 | * $messages = $I->grabSentEmails(); 750 | * $I->assertEquals('admin@site,com', $messages[0]->getTo()); 751 | * ``` 752 | * 753 | * @part email 754 | * @return array 755 | * @throws ModuleException 756 | * @see \Codeception\Module\Yii2::grabSentEmails() 757 | */ 758 | public function grabSentEmails() { 759 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabSentEmails', func_get_args())); 760 | } 761 | 762 | 763 | /** 764 | * [!] Method is generated. Documentation taken from corresponding module. 765 | * 766 | * Returns last sent email: 767 | * 768 | * ```php 769 | * seeEmailIsSent(); 771 | * $message = $I->grabLastSentEmail(); 772 | * $I->assertEquals('admin@site,com', $message->getTo()); 773 | * ``` 774 | * @part email 775 | * @see \Codeception\Module\Yii2::grabLastSentEmail() 776 | */ 777 | public function grabLastSentEmail() { 778 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabLastSentEmail', func_get_args())); 779 | } 780 | 781 | 782 | /** 783 | * [!] Method is generated. Documentation taken from corresponding module. 784 | * 785 | * Returns a list of regex patterns for recognized domain names 786 | * 787 | * @return array 788 | * @see \Codeception\Module\Yii2::getInternalDomains() 789 | */ 790 | public function getInternalDomains() { 791 | return $this->getScenario()->runStep(new \Codeception\Step\Action('getInternalDomains', func_get_args())); 792 | } 793 | 794 | 795 | /** 796 | * [!] Method is generated. Documentation taken from corresponding module. 797 | * 798 | * Authenticates user for HTTP_AUTH 799 | * 800 | * @param $username 801 | * @param $password 802 | * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() 803 | */ 804 | public function amHttpAuthenticated($username, $password) { 805 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); 806 | } 807 | 808 | 809 | /** 810 | * [!] Method is generated. Documentation taken from corresponding module. 811 | * 812 | * Sets the HTTP header to the passed value - which is used on 813 | * subsequent HTTP requests through PhpBrowser. 814 | * 815 | * Example: 816 | * ```php 817 | * setHeader('X-Requested-With', 'Codeception'); 819 | * $I->amOnPage('test-headers.php'); 820 | * ?> 821 | * ``` 822 | * 823 | * @param string $name the name of the request header 824 | * @param string $value the value to set it to for subsequent 825 | * requests 826 | * @see \Codeception\Lib\InnerBrowser::haveHttpHeader() 827 | */ 828 | public function haveHttpHeader($name, $value) { 829 | return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args())); 830 | } 831 | 832 | 833 | /** 834 | * [!] Method is generated. Documentation taken from corresponding module. 835 | * 836 | * Deletes the header with the passed name. Subsequent requests 837 | * will not have the deleted header in its request. 838 | * 839 | * Example: 840 | * ```php 841 | * haveHttpHeader('X-Requested-With', 'Codeception'); 843 | * $I->amOnPage('test-headers.php'); 844 | * // ... 845 | * $I->deleteHeader('X-Requested-With'); 846 | * $I->amOnPage('some-other-page.php'); 847 | * ?> 848 | * ``` 849 | * 850 | * @param string $name the name of the header to delete. 851 | * @see \Codeception\Lib\InnerBrowser::deleteHeader() 852 | */ 853 | public function deleteHeader($name) { 854 | return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); 855 | } 856 | 857 | 858 | /** 859 | * [!] Method is generated. Documentation taken from corresponding module. 860 | * 861 | * Opens the page for the given relative URI. 862 | * 863 | * ``` php 864 | * amOnPage('/'); 867 | * // opens /register page 868 | * $I->amOnPage('/register'); 869 | * ``` 870 | * 871 | * @param $page 872 | * @see \Codeception\Lib\InnerBrowser::amOnPage() 873 | */ 874 | public function amOnPage($page) { 875 | return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); 876 | } 877 | 878 | 879 | /** 880 | * [!] Method is generated. Documentation taken from corresponding module. 881 | * 882 | * Perform a click on a link or a button, given by a locator. 883 | * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. 884 | * For buttons, the "value" attribute, "name" attribute, and inner text are searched. 885 | * For links, the link text is searched. 886 | * For images, the "alt" attribute and inner text of any parent links are searched. 887 | * 888 | * The second parameter is a context (CSS or XPath locator) to narrow the search. 889 | * 890 | * Note that if the locator matches a button of type `submit`, the form will be submitted. 891 | * 892 | * ``` php 893 | * click('Logout'); 896 | * // button of form 897 | * $I->click('Submit'); 898 | * // CSS button 899 | * $I->click('#form input[type=submit]'); 900 | * // XPath 901 | * $I->click('//form/*[@type=submit]'); 902 | * // link in context 903 | * $I->click('Logout', '#nav'); 904 | * // using strict locator 905 | * $I->click(['link' => 'Login']); 906 | * ?> 907 | * ``` 908 | * 909 | * @param $link 910 | * @param $context 911 | * @see \Codeception\Lib\InnerBrowser::click() 912 | */ 913 | public function click($link, $context = null) { 914 | return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); 915 | } 916 | 917 | 918 | /** 919 | * [!] Method is generated. Documentation taken from corresponding module. 920 | * 921 | * Checks that the current page contains the given string (case insensitive). 922 | * 923 | * You can specify a specific HTML element (via CSS or XPath) as the second 924 | * parameter to only search within that element. 925 | * 926 | * ``` php 927 | * see('Logout'); // I can suppose user is logged in 929 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page 930 | * $I->see('Sign Up', '//body/h1'); // with XPath 931 | * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator 932 | * ``` 933 | * 934 | * Note that the search is done after stripping all HTML tags from the body, 935 | * so `$I->see('strong')` will return true for strings like: 936 | * 937 | * - `

I am Stronger than thou

` 938 | * - `` 939 | * 940 | * But will *not* be true for strings like: 941 | * 942 | * - `Home` 943 | * - `
Home` 944 | * - `` 945 | * 946 | * For checking the raw source code, use `seeInSource()`. 947 | * 948 | * @param $text 949 | * @param null $selector 950 | * Conditional Assertion: Test won't be stopped on fail 951 | * @see \Codeception\Lib\InnerBrowser::see() 952 | */ 953 | public function canSee($text, $selector = null) { 954 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('see', func_get_args())); 955 | } 956 | /** 957 | * [!] Method is generated. Documentation taken from corresponding module. 958 | * 959 | * Checks that the current page contains the given string (case insensitive). 960 | * 961 | * You can specify a specific HTML element (via CSS or XPath) as the second 962 | * parameter to only search within that element. 963 | * 964 | * ``` php 965 | * see('Logout'); // I can suppose user is logged in 967 | * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page 968 | * $I->see('Sign Up', '//body/h1'); // with XPath 969 | * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator 970 | * ``` 971 | * 972 | * Note that the search is done after stripping all HTML tags from the body, 973 | * so `$I->see('strong')` will return true for strings like: 974 | * 975 | * - `

I am Stronger than thou

` 976 | * - `` 977 | * 978 | * But will *not* be true for strings like: 979 | * 980 | * - `Home` 981 | * - `
Home` 982 | * - `` 983 | * 984 | * For checking the raw source code, use `seeInSource()`. 985 | * 986 | * @param $text 987 | * @param null $selector 988 | * @see \Codeception\Lib\InnerBrowser::see() 989 | */ 990 | public function see($text, $selector = null) { 991 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('see', func_get_args())); 992 | } 993 | 994 | 995 | /** 996 | * [!] Method is generated. Documentation taken from corresponding module. 997 | * 998 | * Checks that the current page doesn't contain the text specified (case insensitive). 999 | * Give a locator as the second parameter to match a specific region. 1000 | * 1001 | * ```php 1002 | * dontSee('Login'); // I can suppose user is already logged in 1004 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page 1005 | * $I->dontSee('Sign Up','//body/h1'); // with XPath 1006 | * $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator 1007 | * ``` 1008 | * 1009 | * Note that the search is done after stripping all HTML tags from the body, 1010 | * so `$I->dontSee('strong')` will fail on strings like: 1011 | * 1012 | * - `

I am Stronger than thou

` 1013 | * - `` 1014 | * 1015 | * But will ignore strings like: 1016 | * 1017 | * - `Home` 1018 | * - `
Home` 1019 | * - `` 1020 | * 1021 | * For checking the raw source code, use `seeInSource()`. 1022 | * 1023 | * @param $text 1024 | * @param null $selector 1025 | * Conditional Assertion: Test won't be stopped on fail 1026 | * @see \Codeception\Lib\InnerBrowser::dontSee() 1027 | */ 1028 | public function cantSee($text, $selector = null) { 1029 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSee', func_get_args())); 1030 | } 1031 | /** 1032 | * [!] Method is generated. Documentation taken from corresponding module. 1033 | * 1034 | * Checks that the current page doesn't contain the text specified (case insensitive). 1035 | * Give a locator as the second parameter to match a specific region. 1036 | * 1037 | * ```php 1038 | * dontSee('Login'); // I can suppose user is already logged in 1040 | * $I->dontSee('Sign Up','h1'); // I can suppose it's not a signup page 1041 | * $I->dontSee('Sign Up','//body/h1'); // with XPath 1042 | * $I->dontSee('Sign Up', ['css' => 'body h1']); // with strict CSS locator 1043 | * ``` 1044 | * 1045 | * Note that the search is done after stripping all HTML tags from the body, 1046 | * so `$I->dontSee('strong')` will fail on strings like: 1047 | * 1048 | * - `

I am Stronger than thou

` 1049 | * - `` 1050 | * 1051 | * But will ignore strings like: 1052 | * 1053 | * - `Home` 1054 | * - `
Home` 1055 | * - `` 1056 | * 1057 | * For checking the raw source code, use `seeInSource()`. 1058 | * 1059 | * @param $text 1060 | * @param null $selector 1061 | * @see \Codeception\Lib\InnerBrowser::dontSee() 1062 | */ 1063 | public function dontSee($text, $selector = null) { 1064 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSee', func_get_args())); 1065 | } 1066 | 1067 | 1068 | /** 1069 | * [!] Method is generated. Documentation taken from corresponding module. 1070 | * 1071 | * Checks that the current page contains the given string in its 1072 | * raw source code. 1073 | * 1074 | * ``` php 1075 | * seeInSource('

Green eggs & ham

'); 1077 | * ``` 1078 | * 1079 | * @param $raw 1080 | * Conditional Assertion: Test won't be stopped on fail 1081 | * @see \Codeception\Lib\InnerBrowser::seeInSource() 1082 | */ 1083 | public function canSeeInSource($raw) { 1084 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInSource', func_get_args())); 1085 | } 1086 | /** 1087 | * [!] Method is generated. Documentation taken from corresponding module. 1088 | * 1089 | * Checks that the current page contains the given string in its 1090 | * raw source code. 1091 | * 1092 | * ``` php 1093 | * seeInSource('

Green eggs & ham

'); 1095 | * ``` 1096 | * 1097 | * @param $raw 1098 | * @see \Codeception\Lib\InnerBrowser::seeInSource() 1099 | */ 1100 | public function seeInSource($raw) { 1101 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInSource', func_get_args())); 1102 | } 1103 | 1104 | 1105 | /** 1106 | * [!] Method is generated. Documentation taken from corresponding module. 1107 | * 1108 | * Checks that the current page contains the given string in its 1109 | * raw source code. 1110 | * 1111 | * ```php 1112 | * dontSeeInSource('

Green eggs & ham

'); 1114 | * ``` 1115 | * 1116 | * @param $raw 1117 | * Conditional Assertion: Test won't be stopped on fail 1118 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() 1119 | */ 1120 | public function cantSeeInSource($raw) { 1121 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInSource', func_get_args())); 1122 | } 1123 | /** 1124 | * [!] Method is generated. Documentation taken from corresponding module. 1125 | * 1126 | * Checks that the current page contains the given string in its 1127 | * raw source code. 1128 | * 1129 | * ```php 1130 | * dontSeeInSource('

Green eggs & ham

'); 1132 | * ``` 1133 | * 1134 | * @param $raw 1135 | * @see \Codeception\Lib\InnerBrowser::dontSeeInSource() 1136 | */ 1137 | public function dontSeeInSource($raw) { 1138 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInSource', func_get_args())); 1139 | } 1140 | 1141 | 1142 | /** 1143 | * [!] Method is generated. Documentation taken from corresponding module. 1144 | * 1145 | * Checks that there's a link with the specified text. 1146 | * Give a full URL as the second parameter to match links with that exact URL. 1147 | * 1148 | * ``` php 1149 | * seeLink('Logout'); // matches Logout 1151 | * $I->seeLink('Logout','/logout'); // matches Logout 1152 | * ?> 1153 | * ``` 1154 | * 1155 | * @param $text 1156 | * @param null $url 1157 | * Conditional Assertion: Test won't be stopped on fail 1158 | * @see \Codeception\Lib\InnerBrowser::seeLink() 1159 | */ 1160 | public function canSeeLink($text, $url = null) { 1161 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeLink', func_get_args())); 1162 | } 1163 | /** 1164 | * [!] Method is generated. Documentation taken from corresponding module. 1165 | * 1166 | * Checks that there's a link with the specified text. 1167 | * Give a full URL as the second parameter to match links with that exact URL. 1168 | * 1169 | * ``` php 1170 | * seeLink('Logout'); // matches Logout 1172 | * $I->seeLink('Logout','/logout'); // matches Logout 1173 | * ?> 1174 | * ``` 1175 | * 1176 | * @param $text 1177 | * @param null $url 1178 | * @see \Codeception\Lib\InnerBrowser::seeLink() 1179 | */ 1180 | public function seeLink($text, $url = null) { 1181 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeLink', func_get_args())); 1182 | } 1183 | 1184 | 1185 | /** 1186 | * [!] Method is generated. Documentation taken from corresponding module. 1187 | * 1188 | * Checks that the page doesn't contain a link with the given string. 1189 | * If the second parameter is given, only links with a matching "href" attribute will be checked. 1190 | * 1191 | * ``` php 1192 | * dontSeeLink('Logout'); // I suppose user is not logged in 1194 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); 1195 | * ?> 1196 | * ``` 1197 | * 1198 | * @param $text 1199 | * @param null $url 1200 | * Conditional Assertion: Test won't be stopped on fail 1201 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() 1202 | */ 1203 | public function cantSeeLink($text, $url = null) { 1204 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeLink', func_get_args())); 1205 | } 1206 | /** 1207 | * [!] Method is generated. Documentation taken from corresponding module. 1208 | * 1209 | * Checks that the page doesn't contain a link with the given string. 1210 | * If the second parameter is given, only links with a matching "href" attribute will be checked. 1211 | * 1212 | * ``` php 1213 | * dontSeeLink('Logout'); // I suppose user is not logged in 1215 | * $I->dontSeeLink('Checkout now', '/store/cart.php'); 1216 | * ?> 1217 | * ``` 1218 | * 1219 | * @param $text 1220 | * @param null $url 1221 | * @see \Codeception\Lib\InnerBrowser::dontSeeLink() 1222 | */ 1223 | public function dontSeeLink($text, $url = null) { 1224 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeLink', func_get_args())); 1225 | } 1226 | 1227 | 1228 | /** 1229 | * [!] Method is generated. Documentation taken from corresponding module. 1230 | * 1231 | * Checks that current URI contains the given string. 1232 | * 1233 | * ``` php 1234 | * seeInCurrentUrl('home'); 1237 | * // to match: /users/1 1238 | * $I->seeInCurrentUrl('/users/'); 1239 | * ?> 1240 | * ``` 1241 | * 1242 | * @param $uri 1243 | * Conditional Assertion: Test won't be stopped on fail 1244 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() 1245 | */ 1246 | public function canSeeInCurrentUrl($uri) { 1247 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentUrl', func_get_args())); 1248 | } 1249 | /** 1250 | * [!] Method is generated. Documentation taken from corresponding module. 1251 | * 1252 | * Checks that current URI contains the given string. 1253 | * 1254 | * ``` php 1255 | * seeInCurrentUrl('home'); 1258 | * // to match: /users/1 1259 | * $I->seeInCurrentUrl('/users/'); 1260 | * ?> 1261 | * ``` 1262 | * 1263 | * @param $uri 1264 | * @see \Codeception\Lib\InnerBrowser::seeInCurrentUrl() 1265 | */ 1266 | public function seeInCurrentUrl($uri) { 1267 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentUrl', func_get_args())); 1268 | } 1269 | 1270 | 1271 | /** 1272 | * [!] Method is generated. Documentation taken from corresponding module. 1273 | * 1274 | * Checks that the current URI doesn't contain the given string. 1275 | * 1276 | * ``` php 1277 | * dontSeeInCurrentUrl('/users/'); 1279 | * ?> 1280 | * ``` 1281 | * 1282 | * @param $uri 1283 | * Conditional Assertion: Test won't be stopped on fail 1284 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() 1285 | */ 1286 | public function cantSeeInCurrentUrl($uri) { 1287 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInCurrentUrl', func_get_args())); 1288 | } 1289 | /** 1290 | * [!] Method is generated. Documentation taken from corresponding module. 1291 | * 1292 | * Checks that the current URI doesn't contain the given string. 1293 | * 1294 | * ``` php 1295 | * dontSeeInCurrentUrl('/users/'); 1297 | * ?> 1298 | * ``` 1299 | * 1300 | * @param $uri 1301 | * @see \Codeception\Lib\InnerBrowser::dontSeeInCurrentUrl() 1302 | */ 1303 | public function dontSeeInCurrentUrl($uri) { 1304 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInCurrentUrl', func_get_args())); 1305 | } 1306 | 1307 | 1308 | /** 1309 | * [!] Method is generated. Documentation taken from corresponding module. 1310 | * 1311 | * Checks that the current URL is equal to the given string. 1312 | * Unlike `seeInCurrentUrl`, this only matches the full URL. 1313 | * 1314 | * ``` php 1315 | * seeCurrentUrlEquals('/'); 1318 | * ?> 1319 | * ``` 1320 | * 1321 | * @param $uri 1322 | * Conditional Assertion: Test won't be stopped on fail 1323 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() 1324 | */ 1325 | public function canSeeCurrentUrlEquals($uri) { 1326 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlEquals', func_get_args())); 1327 | } 1328 | /** 1329 | * [!] Method is generated. Documentation taken from corresponding module. 1330 | * 1331 | * Checks that the current URL is equal to the given string. 1332 | * Unlike `seeInCurrentUrl`, this only matches the full URL. 1333 | * 1334 | * ``` php 1335 | * seeCurrentUrlEquals('/'); 1338 | * ?> 1339 | * ``` 1340 | * 1341 | * @param $uri 1342 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlEquals() 1343 | */ 1344 | public function seeCurrentUrlEquals($uri) { 1345 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlEquals', func_get_args())); 1346 | } 1347 | 1348 | 1349 | /** 1350 | * [!] Method is generated. Documentation taken from corresponding module. 1351 | * 1352 | * Checks that the current URL doesn't equal the given string. 1353 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. 1354 | * 1355 | * ``` php 1356 | * dontSeeCurrentUrlEquals('/'); 1359 | * ?> 1360 | * ``` 1361 | * 1362 | * @param $uri 1363 | * Conditional Assertion: Test won't be stopped on fail 1364 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() 1365 | */ 1366 | public function cantSeeCurrentUrlEquals($uri) { 1367 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlEquals', func_get_args())); 1368 | } 1369 | /** 1370 | * [!] Method is generated. Documentation taken from corresponding module. 1371 | * 1372 | * Checks that the current URL doesn't equal the given string. 1373 | * Unlike `dontSeeInCurrentUrl`, this only matches the full URL. 1374 | * 1375 | * ``` php 1376 | * dontSeeCurrentUrlEquals('/'); 1379 | * ?> 1380 | * ``` 1381 | * 1382 | * @param $uri 1383 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlEquals() 1384 | */ 1385 | public function dontSeeCurrentUrlEquals($uri) { 1386 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlEquals', func_get_args())); 1387 | } 1388 | 1389 | 1390 | /** 1391 | * [!] Method is generated. Documentation taken from corresponding module. 1392 | * 1393 | * Checks that the current URL matches the given regular expression. 1394 | * 1395 | * ``` php 1396 | * seeCurrentUrlMatches('~$/users/(\d+)~'); 1399 | * ?> 1400 | * ``` 1401 | * 1402 | * @param $uri 1403 | * Conditional Assertion: Test won't be stopped on fail 1404 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() 1405 | */ 1406 | public function canSeeCurrentUrlMatches($uri) { 1407 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentUrlMatches', func_get_args())); 1408 | } 1409 | /** 1410 | * [!] Method is generated. Documentation taken from corresponding module. 1411 | * 1412 | * Checks that the current URL matches the given regular expression. 1413 | * 1414 | * ``` php 1415 | * seeCurrentUrlMatches('~$/users/(\d+)~'); 1418 | * ?> 1419 | * ``` 1420 | * 1421 | * @param $uri 1422 | * @see \Codeception\Lib\InnerBrowser::seeCurrentUrlMatches() 1423 | */ 1424 | public function seeCurrentUrlMatches($uri) { 1425 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentUrlMatches', func_get_args())); 1426 | } 1427 | 1428 | 1429 | /** 1430 | * [!] Method is generated. Documentation taken from corresponding module. 1431 | * 1432 | * Checks that current url doesn't match the given regular expression. 1433 | * 1434 | * ``` php 1435 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); 1438 | * ?> 1439 | * ``` 1440 | * 1441 | * @param $uri 1442 | * Conditional Assertion: Test won't be stopped on fail 1443 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() 1444 | */ 1445 | public function cantSeeCurrentUrlMatches($uri) { 1446 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCurrentUrlMatches', func_get_args())); 1447 | } 1448 | /** 1449 | * [!] Method is generated. Documentation taken from corresponding module. 1450 | * 1451 | * Checks that current url doesn't match the given regular expression. 1452 | * 1453 | * ``` php 1454 | * dontSeeCurrentUrlMatches('~$/users/(\d+)~'); 1457 | * ?> 1458 | * ``` 1459 | * 1460 | * @param $uri 1461 | * @see \Codeception\Lib\InnerBrowser::dontSeeCurrentUrlMatches() 1462 | */ 1463 | public function dontSeeCurrentUrlMatches($uri) { 1464 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCurrentUrlMatches', func_get_args())); 1465 | } 1466 | 1467 | 1468 | /** 1469 | * [!] Method is generated. Documentation taken from corresponding module. 1470 | * 1471 | * Executes the given regular expression against the current URI and returns the first match. 1472 | * If no parameters are provided, the full URI is returned. 1473 | * 1474 | * ``` php 1475 | * grabFromCurrentUrl('~$/user/(\d+)/~'); 1477 | * $uri = $I->grabFromCurrentUrl(); 1478 | * ?> 1479 | * ``` 1480 | * 1481 | * @param null $uri 1482 | * 1483 | * @return mixed 1484 | * @see \Codeception\Lib\InnerBrowser::grabFromCurrentUrl() 1485 | */ 1486 | public function grabFromCurrentUrl($uri = null) { 1487 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabFromCurrentUrl', func_get_args())); 1488 | } 1489 | 1490 | 1491 | /** 1492 | * [!] Method is generated. Documentation taken from corresponding module. 1493 | * 1494 | * Checks that the specified checkbox is checked. 1495 | * 1496 | * ``` php 1497 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms 1499 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. 1500 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); 1501 | * ?> 1502 | * ``` 1503 | * 1504 | * @param $checkbox 1505 | * Conditional Assertion: Test won't be stopped on fail 1506 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() 1507 | */ 1508 | public function canSeeCheckboxIsChecked($checkbox) { 1509 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCheckboxIsChecked', func_get_args())); 1510 | } 1511 | /** 1512 | * [!] Method is generated. Documentation taken from corresponding module. 1513 | * 1514 | * Checks that the specified checkbox is checked. 1515 | * 1516 | * ``` php 1517 | * seeCheckboxIsChecked('#agree'); // I suppose user agreed to terms 1519 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user agreed to terms, If there is only one checkbox in form. 1520 | * $I->seeCheckboxIsChecked('//form/input[@type=checkbox and @name=agree]'); 1521 | * ?> 1522 | * ``` 1523 | * 1524 | * @param $checkbox 1525 | * @see \Codeception\Lib\InnerBrowser::seeCheckboxIsChecked() 1526 | */ 1527 | public function seeCheckboxIsChecked($checkbox) { 1528 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCheckboxIsChecked', func_get_args())); 1529 | } 1530 | 1531 | 1532 | /** 1533 | * [!] Method is generated. Documentation taken from corresponding module. 1534 | * 1535 | * Check that the specified checkbox is unchecked. 1536 | * 1537 | * ``` php 1538 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms 1540 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. 1541 | * ?> 1542 | * ``` 1543 | * 1544 | * @param $checkbox 1545 | * Conditional Assertion: Test won't be stopped on fail 1546 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() 1547 | */ 1548 | public function cantSeeCheckboxIsChecked($checkbox) { 1549 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCheckboxIsChecked', func_get_args())); 1550 | } 1551 | /** 1552 | * [!] Method is generated. Documentation taken from corresponding module. 1553 | * 1554 | * Check that the specified checkbox is unchecked. 1555 | * 1556 | * ``` php 1557 | * dontSeeCheckboxIsChecked('#agree'); // I suppose user didn't agree to terms 1559 | * $I->seeCheckboxIsChecked('#signup_form input[type=checkbox]'); // I suppose user didn't check the first checkbox in form. 1560 | * ?> 1561 | * ``` 1562 | * 1563 | * @param $checkbox 1564 | * @see \Codeception\Lib\InnerBrowser::dontSeeCheckboxIsChecked() 1565 | */ 1566 | public function dontSeeCheckboxIsChecked($checkbox) { 1567 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCheckboxIsChecked', func_get_args())); 1568 | } 1569 | 1570 | 1571 | /** 1572 | * [!] Method is generated. Documentation taken from corresponding module. 1573 | * 1574 | * Checks that the given input field or textarea contains the given value. 1575 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. 1576 | * 1577 | * ``` php 1578 | * seeInField('Body','Type your comment here'); 1580 | * $I->seeInField('form textarea[name=body]','Type your comment here'); 1581 | * $I->seeInField('form input[type=hidden]','hidden_value'); 1582 | * $I->seeInField('#searchform input','Search'); 1583 | * $I->seeInField('//form/*[@name=search]','Search'); 1584 | * $I->seeInField(['name' => 'search'], 'Search'); 1585 | * ?> 1586 | * ``` 1587 | * 1588 | * @param $field 1589 | * @param $value 1590 | * Conditional Assertion: Test won't be stopped on fail 1591 | * @see \Codeception\Lib\InnerBrowser::seeInField() 1592 | */ 1593 | public function canSeeInField($field, $value) { 1594 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInField', func_get_args())); 1595 | } 1596 | /** 1597 | * [!] Method is generated. Documentation taken from corresponding module. 1598 | * 1599 | * Checks that the given input field or textarea contains the given value. 1600 | * For fuzzy locators, fields are matched by label text, the "name" attribute, CSS, and XPath. 1601 | * 1602 | * ``` php 1603 | * seeInField('Body','Type your comment here'); 1605 | * $I->seeInField('form textarea[name=body]','Type your comment here'); 1606 | * $I->seeInField('form input[type=hidden]','hidden_value'); 1607 | * $I->seeInField('#searchform input','Search'); 1608 | * $I->seeInField('//form/*[@name=search]','Search'); 1609 | * $I->seeInField(['name' => 'search'], 'Search'); 1610 | * ?> 1611 | * ``` 1612 | * 1613 | * @param $field 1614 | * @param $value 1615 | * @see \Codeception\Lib\InnerBrowser::seeInField() 1616 | */ 1617 | public function seeInField($field, $value) { 1618 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInField', func_get_args())); 1619 | } 1620 | 1621 | 1622 | /** 1623 | * [!] Method is generated. Documentation taken from corresponding module. 1624 | * 1625 | * Checks that an input field or textarea doesn't contain the given value. 1626 | * For fuzzy locators, the field is matched by label text, CSS and XPath. 1627 | * 1628 | * ``` php 1629 | * dontSeeInField('Body','Type your comment here'); 1631 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); 1632 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); 1633 | * $I->dontSeeInField('#searchform input','Search'); 1634 | * $I->dontSeeInField('//form/*[@name=search]','Search'); 1635 | * $I->dontSeeInField(['name' => 'search'], 'Search'); 1636 | * ?> 1637 | * ``` 1638 | * 1639 | * @param $field 1640 | * @param $value 1641 | * Conditional Assertion: Test won't be stopped on fail 1642 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() 1643 | */ 1644 | public function cantSeeInField($field, $value) { 1645 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInField', func_get_args())); 1646 | } 1647 | /** 1648 | * [!] Method is generated. Documentation taken from corresponding module. 1649 | * 1650 | * Checks that an input field or textarea doesn't contain the given value. 1651 | * For fuzzy locators, the field is matched by label text, CSS and XPath. 1652 | * 1653 | * ``` php 1654 | * dontSeeInField('Body','Type your comment here'); 1656 | * $I->dontSeeInField('form textarea[name=body]','Type your comment here'); 1657 | * $I->dontSeeInField('form input[type=hidden]','hidden_value'); 1658 | * $I->dontSeeInField('#searchform input','Search'); 1659 | * $I->dontSeeInField('//form/*[@name=search]','Search'); 1660 | * $I->dontSeeInField(['name' => 'search'], 'Search'); 1661 | * ?> 1662 | * ``` 1663 | * 1664 | * @param $field 1665 | * @param $value 1666 | * @see \Codeception\Lib\InnerBrowser::dontSeeInField() 1667 | */ 1668 | public function dontSeeInField($field, $value) { 1669 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInField', func_get_args())); 1670 | } 1671 | 1672 | 1673 | /** 1674 | * [!] Method is generated. Documentation taken from corresponding module. 1675 | * 1676 | * Checks if the array of form parameters (name => value) are set on the form matched with the 1677 | * passed selector. 1678 | * 1679 | * ``` php 1680 | * seeInFormFields('form[name=myform]', [ 1682 | * 'input1' => 'value', 1683 | * 'input2' => 'other value', 1684 | * ]); 1685 | * ?> 1686 | * ``` 1687 | * 1688 | * For multi-select elements, or to check values of multiple elements with the same name, an 1689 | * array may be passed: 1690 | * 1691 | * ``` php 1692 | * seeInFormFields('.form-class', [ 1694 | * 'multiselect' => [ 1695 | * 'value1', 1696 | * 'value2', 1697 | * ], 1698 | * 'checkbox[]' => [ 1699 | * 'a checked value', 1700 | * 'another checked value', 1701 | * ], 1702 | * ]); 1703 | * ?> 1704 | * ``` 1705 | * 1706 | * Additionally, checkbox values can be checked with a boolean. 1707 | * 1708 | * ``` php 1709 | * seeInFormFields('#form-id', [ 1711 | * 'checkbox1' => true, // passes if checked 1712 | * 'checkbox2' => false, // passes if unchecked 1713 | * ]); 1714 | * ?> 1715 | * ``` 1716 | * 1717 | * Pair this with submitForm for quick testing magic. 1718 | * 1719 | * ``` php 1720 | * 'value', 1723 | * 'field2' => 'another value', 1724 | * 'checkbox1' => true, 1725 | * // ... 1726 | * ]; 1727 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); 1728 | * // $I->amOnPage('/path/to/form-page') may be needed 1729 | * $I->seeInFormFields('//form[@id=my-form]', $form); 1730 | * ?> 1731 | * ``` 1732 | * 1733 | * @param $formSelector 1734 | * @param $params 1735 | * Conditional Assertion: Test won't be stopped on fail 1736 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() 1737 | */ 1738 | public function canSeeInFormFields($formSelector, $params) { 1739 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInFormFields', func_get_args())); 1740 | } 1741 | /** 1742 | * [!] Method is generated. Documentation taken from corresponding module. 1743 | * 1744 | * Checks if the array of form parameters (name => value) are set on the form matched with the 1745 | * passed selector. 1746 | * 1747 | * ``` php 1748 | * seeInFormFields('form[name=myform]', [ 1750 | * 'input1' => 'value', 1751 | * 'input2' => 'other value', 1752 | * ]); 1753 | * ?> 1754 | * ``` 1755 | * 1756 | * For multi-select elements, or to check values of multiple elements with the same name, an 1757 | * array may be passed: 1758 | * 1759 | * ``` php 1760 | * seeInFormFields('.form-class', [ 1762 | * 'multiselect' => [ 1763 | * 'value1', 1764 | * 'value2', 1765 | * ], 1766 | * 'checkbox[]' => [ 1767 | * 'a checked value', 1768 | * 'another checked value', 1769 | * ], 1770 | * ]); 1771 | * ?> 1772 | * ``` 1773 | * 1774 | * Additionally, checkbox values can be checked with a boolean. 1775 | * 1776 | * ``` php 1777 | * seeInFormFields('#form-id', [ 1779 | * 'checkbox1' => true, // passes if checked 1780 | * 'checkbox2' => false, // passes if unchecked 1781 | * ]); 1782 | * ?> 1783 | * ``` 1784 | * 1785 | * Pair this with submitForm for quick testing magic. 1786 | * 1787 | * ``` php 1788 | * 'value', 1791 | * 'field2' => 'another value', 1792 | * 'checkbox1' => true, 1793 | * // ... 1794 | * ]; 1795 | * $I->submitForm('//form[@id=my-form]', $form, 'submitButton'); 1796 | * // $I->amOnPage('/path/to/form-page') may be needed 1797 | * $I->seeInFormFields('//form[@id=my-form]', $form); 1798 | * ?> 1799 | * ``` 1800 | * 1801 | * @param $formSelector 1802 | * @param $params 1803 | * @see \Codeception\Lib\InnerBrowser::seeInFormFields() 1804 | */ 1805 | public function seeInFormFields($formSelector, $params) { 1806 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInFormFields', func_get_args())); 1807 | } 1808 | 1809 | 1810 | /** 1811 | * [!] Method is generated. Documentation taken from corresponding module. 1812 | * 1813 | * Checks if the array of form parameters (name => value) are not set on the form matched with 1814 | * the passed selector. 1815 | * 1816 | * ``` php 1817 | * dontSeeInFormFields('form[name=myform]', [ 1819 | * 'input1' => 'non-existent value', 1820 | * 'input2' => 'other non-existent value', 1821 | * ]); 1822 | * ?> 1823 | * ``` 1824 | * 1825 | * To check that an element hasn't been assigned any one of many values, an array can be passed 1826 | * as the value: 1827 | * 1828 | * ``` php 1829 | * dontSeeInFormFields('.form-class', [ 1831 | * 'fieldName' => [ 1832 | * 'This value shouldn\'t be set', 1833 | * 'And this value shouldn\'t be set', 1834 | * ], 1835 | * ]); 1836 | * ?> 1837 | * ``` 1838 | * 1839 | * Additionally, checkbox values can be checked with a boolean. 1840 | * 1841 | * ``` php 1842 | * dontSeeInFormFields('#form-id', [ 1844 | * 'checkbox1' => true, // fails if checked 1845 | * 'checkbox2' => false, // fails if unchecked 1846 | * ]); 1847 | * ?> 1848 | * ``` 1849 | * 1850 | * @param $formSelector 1851 | * @param $params 1852 | * Conditional Assertion: Test won't be stopped on fail 1853 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() 1854 | */ 1855 | public function cantSeeInFormFields($formSelector, $params) { 1856 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInFormFields', func_get_args())); 1857 | } 1858 | /** 1859 | * [!] Method is generated. Documentation taken from corresponding module. 1860 | * 1861 | * Checks if the array of form parameters (name => value) are not set on the form matched with 1862 | * the passed selector. 1863 | * 1864 | * ``` php 1865 | * dontSeeInFormFields('form[name=myform]', [ 1867 | * 'input1' => 'non-existent value', 1868 | * 'input2' => 'other non-existent value', 1869 | * ]); 1870 | * ?> 1871 | * ``` 1872 | * 1873 | * To check that an element hasn't been assigned any one of many values, an array can be passed 1874 | * as the value: 1875 | * 1876 | * ``` php 1877 | * dontSeeInFormFields('.form-class', [ 1879 | * 'fieldName' => [ 1880 | * 'This value shouldn\'t be set', 1881 | * 'And this value shouldn\'t be set', 1882 | * ], 1883 | * ]); 1884 | * ?> 1885 | * ``` 1886 | * 1887 | * Additionally, checkbox values can be checked with a boolean. 1888 | * 1889 | * ``` php 1890 | * dontSeeInFormFields('#form-id', [ 1892 | * 'checkbox1' => true, // fails if checked 1893 | * 'checkbox2' => false, // fails if unchecked 1894 | * ]); 1895 | * ?> 1896 | * ``` 1897 | * 1898 | * @param $formSelector 1899 | * @param $params 1900 | * @see \Codeception\Lib\InnerBrowser::dontSeeInFormFields() 1901 | */ 1902 | public function dontSeeInFormFields($formSelector, $params) { 1903 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInFormFields', func_get_args())); 1904 | } 1905 | 1906 | 1907 | /** 1908 | * [!] Method is generated. Documentation taken from corresponding module. 1909 | * 1910 | * Submits the given form on the page, optionally with the given form 1911 | * values. Pass the form field's values as an array in the second 1912 | * parameter. 1913 | * 1914 | * Although this function can be used as a short-hand version of 1915 | * `fillField()`, `selectOption()`, `click()` etc. it has some important 1916 | * differences: 1917 | * 1918 | * * Only field *names* may be used, not CSS/XPath selectors nor field labels 1919 | * * If a field is sent to this function that does *not* exist on the page, 1920 | * it will silently be added to the HTTP request. This is helpful for testing 1921 | * some types of forms, but be aware that you will *not* get an exception 1922 | * like you would if you called `fillField()` or `selectOption()` with 1923 | * a missing field. 1924 | * 1925 | * Fields that are not provided will be filled by their values from the page, 1926 | * or from any previous calls to `fillField()`, `selectOption()` etc. 1927 | * You don't need to click the 'Submit' button afterwards. 1928 | * This command itself triggers the request to form's action. 1929 | * 1930 | * You can optionally specify which button's value to include 1931 | * in the request with the last parameter (as an alternative to 1932 | * explicitly setting its value in the second parameter), as 1933 | * button values are not otherwise included in the request. 1934 | * 1935 | * Examples: 1936 | * 1937 | * ``` php 1938 | * submitForm('#login', [ 1940 | * 'login' => 'davert', 1941 | * 'password' => '123456' 1942 | * ]); 1943 | * // or 1944 | * $I->submitForm('#login', [ 1945 | * 'login' => 'davert', 1946 | * 'password' => '123456' 1947 | * ], 'submitButtonName'); 1948 | * 1949 | * ``` 1950 | * 1951 | * For example, given this sample "Sign Up" form: 1952 | * 1953 | * ``` html 1954 | *
1955 | * Login: 1956 | *
1957 | * Password: 1958 | *
1959 | * Do you agree to our terms? 1960 | *
1961 | * Select pricing plan: 1962 | * 1966 | * 1967 | *
1968 | * ``` 1969 | * 1970 | * You could write the following to submit it: 1971 | * 1972 | * ``` php 1973 | * submitForm( 1975 | * '#userForm', 1976 | * [ 1977 | * 'user' => [ 1978 | * 'login' => 'Davert', 1979 | * 'password' => '123456', 1980 | * 'agree' => true 1981 | * ] 1982 | * ], 1983 | * 'submitButton' 1984 | * ); 1985 | * ``` 1986 | * Note that "2" will be the submitted value for the "plan" field, as it is 1987 | * the selected option. 1988 | * 1989 | * You can also emulate a JavaScript submission by not specifying any 1990 | * buttons in the third parameter to submitForm. 1991 | * 1992 | * ```php 1993 | * submitForm( 1995 | * '#userForm', 1996 | * [ 1997 | * 'user' => [ 1998 | * 'login' => 'Davert', 1999 | * 'password' => '123456', 2000 | * 'agree' => true 2001 | * ] 2002 | * ] 2003 | * ); 2004 | * ``` 2005 | * 2006 | * This function works well when paired with `seeInFormFields()` 2007 | * for quickly testing CRUD interfaces and form validation logic. 2008 | * 2009 | * ``` php 2010 | * 'value', 2013 | * 'field2' => 'another value', 2014 | * 'checkbox1' => true, 2015 | * // ... 2016 | * ]; 2017 | * $I->submitForm('#my-form', $form, 'submitButton'); 2018 | * // $I->amOnPage('/path/to/form-page') may be needed 2019 | * $I->seeInFormFields('#my-form', $form); 2020 | * ``` 2021 | * 2022 | * Parameter values can be set to arrays for multiple input fields 2023 | * of the same name, or multi-select combo boxes. For checkboxes, 2024 | * you can use either the string value or boolean `true`/`false` which will 2025 | * be replaced by the checkbox's value in the DOM. 2026 | * 2027 | * ``` php 2028 | * submitForm('#my-form', [ 2030 | * 'field1' => 'value', 2031 | * 'checkbox' => [ 2032 | * 'value of first checkbox', 2033 | * 'value of second checkbox', 2034 | * ], 2035 | * 'otherCheckboxes' => [ 2036 | * true, 2037 | * false, 2038 | * false 2039 | * ], 2040 | * 'multiselect' => [ 2041 | * 'first option value', 2042 | * 'second option value' 2043 | * ] 2044 | * ]); 2045 | * ``` 2046 | * 2047 | * Mixing string and boolean values for a checkbox's value is not supported 2048 | * and may produce unexpected results. 2049 | * 2050 | * Field names ending in `[]` must be passed without the trailing square 2051 | * bracket characters, and must contain an array for its value. This allows 2052 | * submitting multiple values with the same name, consider: 2053 | * 2054 | * ```php 2055 | * submitForm('#my-form', [ 2058 | * 'field[]' => 'value', 2059 | * 'field[]' => 'another value', // 'field[]' is already a defined key 2060 | * ]); 2061 | * ``` 2062 | * 2063 | * The solution is to pass an array value: 2064 | * 2065 | * ```php 2066 | * submitForm('#my-form', [ 2069 | * 'field' => [ 2070 | * 'value', 2071 | * 'another value', 2072 | * ] 2073 | * ]); 2074 | * ``` 2075 | * 2076 | * @param $selector 2077 | * @param $params 2078 | * @param $button 2079 | * @see \Codeception\Lib\InnerBrowser::submitForm() 2080 | */ 2081 | public function submitForm($selector, $params, $button = null) { 2082 | return $this->getScenario()->runStep(new \Codeception\Step\Action('submitForm', func_get_args())); 2083 | } 2084 | 2085 | 2086 | /** 2087 | * [!] Method is generated. Documentation taken from corresponding module. 2088 | * 2089 | * Fills a text field or textarea with the given string. 2090 | * 2091 | * ``` php 2092 | * fillField("//input[@type='text']", "Hello World!"); 2094 | * $I->fillField(['name' => 'email'], 'jon@mail.com'); 2095 | * ?> 2096 | * ``` 2097 | * 2098 | * @param $field 2099 | * @param $value 2100 | * @see \Codeception\Lib\InnerBrowser::fillField() 2101 | */ 2102 | public function fillField($field, $value) { 2103 | return $this->getScenario()->runStep(new \Codeception\Step\Action('fillField', func_get_args())); 2104 | } 2105 | 2106 | 2107 | /** 2108 | * [!] Method is generated. Documentation taken from corresponding module. 2109 | * 2110 | * Selects an option in a select tag or in radio button group. 2111 | * 2112 | * ``` php 2113 | * selectOption('form select[name=account]', 'Premium'); 2115 | * $I->selectOption('form input[name=payment]', 'Monthly'); 2116 | * $I->selectOption('//form/select[@name=account]', 'Monthly'); 2117 | * ?> 2118 | * ``` 2119 | * 2120 | * Provide an array for the second argument to select multiple options: 2121 | * 2122 | * ``` php 2123 | * selectOption('Which OS do you use?', array('Windows','Linux')); 2125 | * ?> 2126 | * ``` 2127 | * 2128 | * Or provide an associative array for the second argument to specifically define which selection method should be used: 2129 | * 2130 | * ``` php 2131 | * selectOption('Which OS do you use?', array('text' => 'Windows')); // Only search by text 'Windows' 2133 | * $I->selectOption('Which OS do you use?', array('value' => 'windows')); // Only search by value 'windows' 2134 | * ?> 2135 | * ``` 2136 | * 2137 | * @param $select 2138 | * @param $option 2139 | * @see \Codeception\Lib\InnerBrowser::selectOption() 2140 | */ 2141 | public function selectOption($select, $option) { 2142 | return $this->getScenario()->runStep(new \Codeception\Step\Action('selectOption', func_get_args())); 2143 | } 2144 | 2145 | 2146 | /** 2147 | * [!] Method is generated. Documentation taken from corresponding module. 2148 | * 2149 | * Ticks a checkbox. For radio buttons, use the `selectOption` method instead. 2150 | * 2151 | * ``` php 2152 | * checkOption('#agree'); 2154 | * ?> 2155 | * ``` 2156 | * 2157 | * @param $option 2158 | * @see \Codeception\Lib\InnerBrowser::checkOption() 2159 | */ 2160 | public function checkOption($option) { 2161 | return $this->getScenario()->runStep(new \Codeception\Step\Action('checkOption', func_get_args())); 2162 | } 2163 | 2164 | 2165 | /** 2166 | * [!] Method is generated. Documentation taken from corresponding module. 2167 | * 2168 | * Unticks a checkbox. 2169 | * 2170 | * ``` php 2171 | * uncheckOption('#notify'); 2173 | * ?> 2174 | * ``` 2175 | * 2176 | * @param $option 2177 | * @see \Codeception\Lib\InnerBrowser::uncheckOption() 2178 | */ 2179 | public function uncheckOption($option) { 2180 | return $this->getScenario()->runStep(new \Codeception\Step\Action('uncheckOption', func_get_args())); 2181 | } 2182 | 2183 | 2184 | /** 2185 | * [!] Method is generated. Documentation taken from corresponding module. 2186 | * 2187 | * Attaches a file relative to the Codeception data directory to the given file upload field. 2188 | * 2189 | * ``` php 2190 | * attachFile('input[@type="file"]', 'prices.xls'); 2193 | * ?> 2194 | * ``` 2195 | * 2196 | * @param $field 2197 | * @param $filename 2198 | * @see \Codeception\Lib\InnerBrowser::attachFile() 2199 | */ 2200 | public function attachFile($field, $filename) { 2201 | return $this->getScenario()->runStep(new \Codeception\Step\Action('attachFile', func_get_args())); 2202 | } 2203 | 2204 | 2205 | /** 2206 | * [!] Method is generated. Documentation taken from corresponding module. 2207 | * 2208 | * If your page triggers an ajax request, you can perform it manually. 2209 | * This action sends a GET ajax request with specified params. 2210 | * 2211 | * See ->sendAjaxPostRequest for examples. 2212 | * 2213 | * @param $uri 2214 | * @param $params 2215 | * @see \Codeception\Lib\InnerBrowser::sendAjaxGetRequest() 2216 | */ 2217 | public function sendAjaxGetRequest($uri, $params = null) { 2218 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxGetRequest', func_get_args())); 2219 | } 2220 | 2221 | 2222 | /** 2223 | * [!] Method is generated. Documentation taken from corresponding module. 2224 | * 2225 | * If your page triggers an ajax request, you can perform it manually. 2226 | * This action sends a POST ajax request with specified params. 2227 | * Additional params can be passed as array. 2228 | * 2229 | * Example: 2230 | * 2231 | * Imagine that by clicking checkbox you trigger ajax request which updates user settings. 2232 | * We emulate that click by running this ajax request manually. 2233 | * 2234 | * ``` php 2235 | * sendAjaxPostRequest('/updateSettings', array('notifications' => true)); // POST 2237 | * $I->sendAjaxGetRequest('/updateSettings', array('notifications' => true)); // GET 2238 | * 2239 | * ``` 2240 | * 2241 | * @param $uri 2242 | * @param $params 2243 | * @see \Codeception\Lib\InnerBrowser::sendAjaxPostRequest() 2244 | */ 2245 | public function sendAjaxPostRequest($uri, $params = null) { 2246 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxPostRequest', func_get_args())); 2247 | } 2248 | 2249 | 2250 | /** 2251 | * [!] Method is generated. Documentation taken from corresponding module. 2252 | * 2253 | * If your page triggers an ajax request, you can perform it manually. 2254 | * This action sends an ajax request with specified method and params. 2255 | * 2256 | * Example: 2257 | * 2258 | * You need to perform an ajax request specifying the HTTP method. 2259 | * 2260 | * ``` php 2261 | * sendAjaxRequest('PUT', '/posts/7', array('title' => 'new title')); 2263 | * 2264 | * ``` 2265 | * 2266 | * @param $method 2267 | * @param $uri 2268 | * @param $params 2269 | * @see \Codeception\Lib\InnerBrowser::sendAjaxRequest() 2270 | */ 2271 | public function sendAjaxRequest($method, $uri, $params = null) { 2272 | return $this->getScenario()->runStep(new \Codeception\Step\Action('sendAjaxRequest', func_get_args())); 2273 | } 2274 | 2275 | 2276 | /** 2277 | * [!] Method is generated. Documentation taken from corresponding module. 2278 | * 2279 | * Finds and returns the text contents of the given element. 2280 | * If a fuzzy locator is used, the element is found using CSS, XPath, 2281 | * and by matching the full page source by regular expression. 2282 | * 2283 | * ``` php 2284 | * grabTextFrom('h1'); 2286 | * $heading = $I->grabTextFrom('descendant-or-self::h1'); 2287 | * $value = $I->grabTextFrom('~ 2289 | * ``` 2290 | * 2291 | * @param $cssOrXPathOrRegex 2292 | * 2293 | * @return mixed 2294 | * @see \Codeception\Lib\InnerBrowser::grabTextFrom() 2295 | */ 2296 | public function grabTextFrom($cssOrXPathOrRegex) { 2297 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabTextFrom', func_get_args())); 2298 | } 2299 | 2300 | 2301 | /** 2302 | * [!] Method is generated. Documentation taken from corresponding module. 2303 | * 2304 | * Grabs the value of the given attribute value from the given element. 2305 | * Fails if element is not found. 2306 | * 2307 | * ``` php 2308 | * grabAttributeFrom('#tooltip', 'title'); 2310 | * ?> 2311 | * ``` 2312 | * 2313 | * 2314 | * @param $cssOrXpath 2315 | * @param $attribute 2316 | * 2317 | * @return mixed 2318 | * @see \Codeception\Lib\InnerBrowser::grabAttributeFrom() 2319 | */ 2320 | public function grabAttributeFrom($cssOrXpath, $attribute) { 2321 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabAttributeFrom', func_get_args())); 2322 | } 2323 | 2324 | 2325 | /** 2326 | * [!] Method is generated. Documentation taken from corresponding module. 2327 | * 2328 | * Grabs either the text content, or attribute values, of nodes 2329 | * matched by $cssOrXpath and returns them as an array. 2330 | * 2331 | * ```html 2332 | * First 2333 | * Second 2334 | * Third 2335 | * ``` 2336 | * 2337 | * ```php 2338 | * grabMultiple('a'); 2341 | * 2342 | * // would return ['#first', '#second', '#third'] 2343 | * $aLinks = $I->grabMultiple('a', 'href'); 2344 | * ?> 2345 | * ``` 2346 | * 2347 | * @param $cssOrXpath 2348 | * @param $attribute 2349 | * @return string[] 2350 | * @see \Codeception\Lib\InnerBrowser::grabMultiple() 2351 | */ 2352 | public function grabMultiple($cssOrXpath, $attribute = null) { 2353 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabMultiple', func_get_args())); 2354 | } 2355 | 2356 | 2357 | /** 2358 | * [!] Method is generated. Documentation taken from corresponding module. 2359 | * 2360 | * @param $field 2361 | * 2362 | * @return array|mixed|null|string 2363 | * @see \Codeception\Lib\InnerBrowser::grabValueFrom() 2364 | */ 2365 | public function grabValueFrom($field) { 2366 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabValueFrom', func_get_args())); 2367 | } 2368 | 2369 | 2370 | /** 2371 | * [!] Method is generated. Documentation taken from corresponding module. 2372 | * 2373 | * Sets a cookie with the given name and value. 2374 | * You can set additional cookie params like `domain`, `path`, `expires`, `secure` in array passed as last argument. 2375 | * 2376 | * ``` php 2377 | * setCookie('PHPSESSID', 'el4ukv0kqbvoirg7nkp4dncpk3'); 2379 | * ?> 2380 | * ``` 2381 | * 2382 | * @param $name 2383 | * @param $val 2384 | * @param array $params 2385 | * 2386 | * @return mixed 2387 | * @see \Codeception\Lib\InnerBrowser::setCookie() 2388 | */ 2389 | public function setCookie($name, $val, $params = null) { 2390 | return $this->getScenario()->runStep(new \Codeception\Step\Action('setCookie', func_get_args())); 2391 | } 2392 | 2393 | 2394 | /** 2395 | * [!] Method is generated. Documentation taken from corresponding module. 2396 | * 2397 | * Grabs a cookie value. 2398 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. 2399 | * 2400 | * @param $cookie 2401 | * 2402 | * @param array $params 2403 | * @return mixed 2404 | * @see \Codeception\Lib\InnerBrowser::grabCookie() 2405 | */ 2406 | public function grabCookie($cookie, $params = null) { 2407 | return $this->getScenario()->runStep(new \Codeception\Step\Action('grabCookie', func_get_args())); 2408 | } 2409 | 2410 | 2411 | /** 2412 | * [!] Method is generated. Documentation taken from corresponding module. 2413 | * 2414 | * Checks that a cookie with the given name is set. 2415 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. 2416 | * 2417 | * ``` php 2418 | * seeCookie('PHPSESSID'); 2420 | * ?> 2421 | * ``` 2422 | * 2423 | * @param $cookie 2424 | * @param array $params 2425 | * @return mixed 2426 | * Conditional Assertion: Test won't be stopped on fail 2427 | * @see \Codeception\Lib\InnerBrowser::seeCookie() 2428 | */ 2429 | public function canSeeCookie($cookie, $params = null) { 2430 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCookie', func_get_args())); 2431 | } 2432 | /** 2433 | * [!] Method is generated. Documentation taken from corresponding module. 2434 | * 2435 | * Checks that a cookie with the given name is set. 2436 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. 2437 | * 2438 | * ``` php 2439 | * seeCookie('PHPSESSID'); 2441 | * ?> 2442 | * ``` 2443 | * 2444 | * @param $cookie 2445 | * @param array $params 2446 | * @return mixed 2447 | * @see \Codeception\Lib\InnerBrowser::seeCookie() 2448 | */ 2449 | public function seeCookie($cookie, $params = null) { 2450 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCookie', func_get_args())); 2451 | } 2452 | 2453 | 2454 | /** 2455 | * [!] Method is generated. Documentation taken from corresponding module. 2456 | * 2457 | * Checks that there isn't a cookie with the given name. 2458 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. 2459 | * 2460 | * @param $cookie 2461 | * 2462 | * @param array $params 2463 | * @return mixed 2464 | * Conditional Assertion: Test won't be stopped on fail 2465 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() 2466 | */ 2467 | public function cantSeeCookie($cookie, $params = null) { 2468 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeCookie', func_get_args())); 2469 | } 2470 | /** 2471 | * [!] Method is generated. Documentation taken from corresponding module. 2472 | * 2473 | * Checks that there isn't a cookie with the given name. 2474 | * You can set additional cookie params like `domain`, `path` as array passed in last argument. 2475 | * 2476 | * @param $cookie 2477 | * 2478 | * @param array $params 2479 | * @return mixed 2480 | * @see \Codeception\Lib\InnerBrowser::dontSeeCookie() 2481 | */ 2482 | public function dontSeeCookie($cookie, $params = null) { 2483 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeCookie', func_get_args())); 2484 | } 2485 | 2486 | 2487 | /** 2488 | * [!] Method is generated. Documentation taken from corresponding module. 2489 | * 2490 | * Unsets cookie with the given name. 2491 | * You can set additional cookie params like `domain`, `path` in array passed as last argument. 2492 | * 2493 | * @param $cookie 2494 | * 2495 | * @param array $params 2496 | * @return mixed 2497 | * @see \Codeception\Lib\InnerBrowser::resetCookie() 2498 | */ 2499 | public function resetCookie($name, $params = null) { 2500 | return $this->getScenario()->runStep(new \Codeception\Step\Action('resetCookie', func_get_args())); 2501 | } 2502 | 2503 | 2504 | /** 2505 | * [!] Method is generated. Documentation taken from corresponding module. 2506 | * 2507 | * Checks that the given element exists on the page and is visible. 2508 | * You can also specify expected attributes of this element. 2509 | * 2510 | * ``` php 2511 | * seeElement('.error'); 2513 | * $I->seeElement('//form/input[1]'); 2514 | * $I->seeElement('input', ['name' => 'login']); 2515 | * $I->seeElement('input', ['value' => '123456']); 2516 | * 2517 | * // strict locator in first arg, attributes in second 2518 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); 2519 | * ?> 2520 | * ``` 2521 | * 2522 | * @param $selector 2523 | * @param array $attributes 2524 | * @return 2525 | * Conditional Assertion: Test won't be stopped on fail 2526 | * @see \Codeception\Lib\InnerBrowser::seeElement() 2527 | */ 2528 | public function canSeeElement($selector, $attributes = null) { 2529 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeElement', func_get_args())); 2530 | } 2531 | /** 2532 | * [!] Method is generated. Documentation taken from corresponding module. 2533 | * 2534 | * Checks that the given element exists on the page and is visible. 2535 | * You can also specify expected attributes of this element. 2536 | * 2537 | * ``` php 2538 | * seeElement('.error'); 2540 | * $I->seeElement('//form/input[1]'); 2541 | * $I->seeElement('input', ['name' => 'login']); 2542 | * $I->seeElement('input', ['value' => '123456']); 2543 | * 2544 | * // strict locator in first arg, attributes in second 2545 | * $I->seeElement(['css' => 'form input'], ['name' => 'login']); 2546 | * ?> 2547 | * ``` 2548 | * 2549 | * @param $selector 2550 | * @param array $attributes 2551 | * @return 2552 | * @see \Codeception\Lib\InnerBrowser::seeElement() 2553 | */ 2554 | public function seeElement($selector, $attributes = null) { 2555 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeElement', func_get_args())); 2556 | } 2557 | 2558 | 2559 | /** 2560 | * [!] Method is generated. Documentation taken from corresponding module. 2561 | * 2562 | * Checks that the given element is invisible or not present on the page. 2563 | * You can also specify expected attributes of this element. 2564 | * 2565 | * ``` php 2566 | * dontSeeElement('.error'); 2568 | * $I->dontSeeElement('//form/input[1]'); 2569 | * $I->dontSeeElement('input', ['name' => 'login']); 2570 | * $I->dontSeeElement('input', ['value' => '123456']); 2571 | * ?> 2572 | * ``` 2573 | * 2574 | * @param $selector 2575 | * @param array $attributes 2576 | * Conditional Assertion: Test won't be stopped on fail 2577 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() 2578 | */ 2579 | public function cantSeeElement($selector, $attributes = null) { 2580 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeElement', func_get_args())); 2581 | } 2582 | /** 2583 | * [!] Method is generated. Documentation taken from corresponding module. 2584 | * 2585 | * Checks that the given element is invisible or not present on the page. 2586 | * You can also specify expected attributes of this element. 2587 | * 2588 | * ``` php 2589 | * dontSeeElement('.error'); 2591 | * $I->dontSeeElement('//form/input[1]'); 2592 | * $I->dontSeeElement('input', ['name' => 'login']); 2593 | * $I->dontSeeElement('input', ['value' => '123456']); 2594 | * ?> 2595 | * ``` 2596 | * 2597 | * @param $selector 2598 | * @param array $attributes 2599 | * @see \Codeception\Lib\InnerBrowser::dontSeeElement() 2600 | */ 2601 | public function dontSeeElement($selector, $attributes = null) { 2602 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeElement', func_get_args())); 2603 | } 2604 | 2605 | 2606 | /** 2607 | * [!] Method is generated. Documentation taken from corresponding module. 2608 | * 2609 | * Checks that there are a certain number of elements matched by the given locator on the page. 2610 | * 2611 | * ``` php 2612 | * seeNumberOfElements('tr', 10); 2614 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements 2615 | * ?> 2616 | * ``` 2617 | * @param $selector 2618 | * @param mixed $expected : 2619 | * - string: strict number 2620 | * - array: range of numbers [0,10] 2621 | * Conditional Assertion: Test won't be stopped on fail 2622 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() 2623 | */ 2624 | public function canSeeNumberOfElements($selector, $expected) { 2625 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberOfElements', func_get_args())); 2626 | } 2627 | /** 2628 | * [!] Method is generated. Documentation taken from corresponding module. 2629 | * 2630 | * Checks that there are a certain number of elements matched by the given locator on the page. 2631 | * 2632 | * ``` php 2633 | * seeNumberOfElements('tr', 10); 2635 | * $I->seeNumberOfElements('tr', [0,10]); //between 0 and 10 elements 2636 | * ?> 2637 | * ``` 2638 | * @param $selector 2639 | * @param mixed $expected : 2640 | * - string: strict number 2641 | * - array: range of numbers [0,10] 2642 | * @see \Codeception\Lib\InnerBrowser::seeNumberOfElements() 2643 | */ 2644 | public function seeNumberOfElements($selector, $expected) { 2645 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberOfElements', func_get_args())); 2646 | } 2647 | 2648 | 2649 | /** 2650 | * [!] Method is generated. Documentation taken from corresponding module. 2651 | * 2652 | * Checks that the given option is selected. 2653 | * 2654 | * ``` php 2655 | * seeOptionIsSelected('#form input[name=payment]', 'Visa'); 2657 | * ?> 2658 | * ``` 2659 | * 2660 | * @param $selector 2661 | * @param $optionText 2662 | * 2663 | * @return mixed 2664 | * Conditional Assertion: Test won't be stopped on fail 2665 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() 2666 | */ 2667 | public function canSeeOptionIsSelected($selector, $optionText) { 2668 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeOptionIsSelected', func_get_args())); 2669 | } 2670 | /** 2671 | * [!] Method is generated. Documentation taken from corresponding module. 2672 | * 2673 | * Checks that the given option is selected. 2674 | * 2675 | * ``` php 2676 | * seeOptionIsSelected('#form input[name=payment]', 'Visa'); 2678 | * ?> 2679 | * ``` 2680 | * 2681 | * @param $selector 2682 | * @param $optionText 2683 | * 2684 | * @return mixed 2685 | * @see \Codeception\Lib\InnerBrowser::seeOptionIsSelected() 2686 | */ 2687 | public function seeOptionIsSelected($selector, $optionText) { 2688 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeOptionIsSelected', func_get_args())); 2689 | } 2690 | 2691 | 2692 | /** 2693 | * [!] Method is generated. Documentation taken from corresponding module. 2694 | * 2695 | * Checks that the given option is not selected. 2696 | * 2697 | * ``` php 2698 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); 2700 | * ?> 2701 | * ``` 2702 | * 2703 | * @param $selector 2704 | * @param $optionText 2705 | * 2706 | * @return mixed 2707 | * Conditional Assertion: Test won't be stopped on fail 2708 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() 2709 | */ 2710 | public function cantSeeOptionIsSelected($selector, $optionText) { 2711 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeOptionIsSelected', func_get_args())); 2712 | } 2713 | /** 2714 | * [!] Method is generated. Documentation taken from corresponding module. 2715 | * 2716 | * Checks that the given option is not selected. 2717 | * 2718 | * ``` php 2719 | * dontSeeOptionIsSelected('#form input[name=payment]', 'Visa'); 2721 | * ?> 2722 | * ``` 2723 | * 2724 | * @param $selector 2725 | * @param $optionText 2726 | * 2727 | * @return mixed 2728 | * @see \Codeception\Lib\InnerBrowser::dontSeeOptionIsSelected() 2729 | */ 2730 | public function dontSeeOptionIsSelected($selector, $optionText) { 2731 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeOptionIsSelected', func_get_args())); 2732 | } 2733 | 2734 | 2735 | /** 2736 | * [!] Method is generated. Documentation taken from corresponding module. 2737 | * 2738 | * Asserts that current page has 404 response status code. 2739 | * Conditional Assertion: Test won't be stopped on fail 2740 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() 2741 | */ 2742 | public function canSeePageNotFound() { 2743 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seePageNotFound', func_get_args())); 2744 | } 2745 | /** 2746 | * [!] Method is generated. Documentation taken from corresponding module. 2747 | * 2748 | * Asserts that current page has 404 response status code. 2749 | * @see \Codeception\Lib\InnerBrowser::seePageNotFound() 2750 | */ 2751 | public function seePageNotFound() { 2752 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seePageNotFound', func_get_args())); 2753 | } 2754 | 2755 | 2756 | /** 2757 | * [!] Method is generated. Documentation taken from corresponding module. 2758 | * 2759 | * Checks that response code is equal to value provided. 2760 | * 2761 | * ```php 2762 | * seeResponseCodeIs(200); 2764 | * 2765 | * // recommended \Codeception\Util\HttpCode 2766 | * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); 2767 | * ``` 2768 | * 2769 | * @param $code 2770 | * Conditional Assertion: Test won't be stopped on fail 2771 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() 2772 | */ 2773 | public function canSeeResponseCodeIs($code) { 2774 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeResponseCodeIs', func_get_args())); 2775 | } 2776 | /** 2777 | * [!] Method is generated. Documentation taken from corresponding module. 2778 | * 2779 | * Checks that response code is equal to value provided. 2780 | * 2781 | * ```php 2782 | * seeResponseCodeIs(200); 2784 | * 2785 | * // recommended \Codeception\Util\HttpCode 2786 | * $I->seeResponseCodeIs(\Codeception\Util\HttpCode::OK); 2787 | * ``` 2788 | * 2789 | * @param $code 2790 | * @see \Codeception\Lib\InnerBrowser::seeResponseCodeIs() 2791 | */ 2792 | public function seeResponseCodeIs($code) { 2793 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeResponseCodeIs', func_get_args())); 2794 | } 2795 | 2796 | 2797 | /** 2798 | * [!] Method is generated. Documentation taken from corresponding module. 2799 | * 2800 | * Checks that response code is equal to value provided. 2801 | * 2802 | * ```php 2803 | * dontSeeResponseCodeIs(200); 2805 | * 2806 | * // recommended \Codeception\Util\HttpCode 2807 | * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); 2808 | * ``` 2809 | * @param $code 2810 | * Conditional Assertion: Test won't be stopped on fail 2811 | * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs() 2812 | */ 2813 | public function cantSeeResponseCodeIs($code) { 2814 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeResponseCodeIs', func_get_args())); 2815 | } 2816 | /** 2817 | * [!] Method is generated. Documentation taken from corresponding module. 2818 | * 2819 | * Checks that response code is equal to value provided. 2820 | * 2821 | * ```php 2822 | * dontSeeResponseCodeIs(200); 2824 | * 2825 | * // recommended \Codeception\Util\HttpCode 2826 | * $I->dontSeeResponseCodeIs(\Codeception\Util\HttpCode::OK); 2827 | * ``` 2828 | * @param $code 2829 | * @see \Codeception\Lib\InnerBrowser::dontSeeResponseCodeIs() 2830 | */ 2831 | public function dontSeeResponseCodeIs($code) { 2832 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeResponseCodeIs', func_get_args())); 2833 | } 2834 | 2835 | 2836 | /** 2837 | * [!] Method is generated. Documentation taken from corresponding module. 2838 | * 2839 | * Checks that the page title contains the given string. 2840 | * 2841 | * ``` php 2842 | * seeInTitle('Blog - Post #1'); 2844 | * ?> 2845 | * ``` 2846 | * 2847 | * @param $title 2848 | * 2849 | * @return mixed 2850 | * Conditional Assertion: Test won't be stopped on fail 2851 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() 2852 | */ 2853 | public function canSeeInTitle($title) { 2854 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInTitle', func_get_args())); 2855 | } 2856 | /** 2857 | * [!] Method is generated. Documentation taken from corresponding module. 2858 | * 2859 | * Checks that the page title contains the given string. 2860 | * 2861 | * ``` php 2862 | * seeInTitle('Blog - Post #1'); 2864 | * ?> 2865 | * ``` 2866 | * 2867 | * @param $title 2868 | * 2869 | * @return mixed 2870 | * @see \Codeception\Lib\InnerBrowser::seeInTitle() 2871 | */ 2872 | public function seeInTitle($title) { 2873 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInTitle', func_get_args())); 2874 | } 2875 | 2876 | 2877 | /** 2878 | * [!] Method is generated. Documentation taken from corresponding module. 2879 | * 2880 | * Checks that the page title does not contain the given string. 2881 | * 2882 | * @param $title 2883 | * 2884 | * @return mixed 2885 | * Conditional Assertion: Test won't be stopped on fail 2886 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() 2887 | */ 2888 | public function cantSeeInTitle($title) { 2889 | return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInTitle', func_get_args())); 2890 | } 2891 | /** 2892 | * [!] Method is generated. Documentation taken from corresponding module. 2893 | * 2894 | * Checks that the page title does not contain the given string. 2895 | * 2896 | * @param $title 2897 | * 2898 | * @return mixed 2899 | * @see \Codeception\Lib\InnerBrowser::dontSeeInTitle() 2900 | */ 2901 | public function dontSeeInTitle($title) { 2902 | return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args())); 2903 | } 2904 | 2905 | 2906 | /** 2907 | * [!] Method is generated. Documentation taken from corresponding module. 2908 | * 2909 | * Switch to iframe or frame on the page. 2910 | * 2911 | * Example: 2912 | * ``` html 2913 | *