Provide console output if related. Use -vvv mode for more details.
Functional Tests (1) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Modules: Asserts, Yii2, REST
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FinanceParkingCest: Test
Signature: tests\functional\ExampleCest:test
Test: tests/functional/Modules/ExampleCest.php:test
Scenario --
[yii\db\Connection::open] 'Opening DB connection: mysql:host=mariadb;port=3306;dbname=test'
[Database] Transaction started
I am logged in as "tests\\_data\\functional\\Modules\\User\\FakeIdentity"
[yii\web\User::login] 'User \'1\' logged in from . Session not enabled.'
I send get "/index-test.php/test/test",[]
[Request] GET /index-test.php/test/test
[Request Headers] []
[yii\filters\RateLimiter::beforeAction] 'Rate limit skipped: "user" does not implement RateLimitInterface.'
[User id is:] 1
[Page] /index-test.php/test/test
[Response] 200
[Request Cookies] []
[Response Headers] {"access-control-expose-headers":["X-Pagination-Total-Count, X-Pagination-Page-Count, X-Pagination-Current-Page, X-Pagination-Per-Page, token-type, access-token, userId"],"content-type":["application/json; charset=UTF-8"]}
[Response] []
I send get "/index-test.php/test/test",[]
[Request] GET /index-test.php/test/test
[Request Headers] []
[yii\filters\RateLimiter::beforeAction] 'Rate limit skipped: user not logged in.'
[User id is:] null
[Page] /index-test.php/test/test
[Response] 200
[Request Cookies] []
[Response Headers] {"access-control-expose-headers":["X-Pagination-Total-Count, X-Pagination-Page-Count, X-Pagination-Current-Page, X-Pagination-Per-Page, token-type, access-token, userId"],"content-type":["application/json; charset=UTF-8"]}
[Response] []
I am logged in as "tests\\_data\\functional\\Modules\\User\\FakeIdentity"
[yii\web\User::login] 'User \'1\' logged in from . Session not enabled.'
I send get "/index-test.php/test/test",[]
[Request] GET /index-test.php/test/test
[Request Headers] []
[yii\filters\RateLimiter::beforeAction] 'Rate limit skipped: user not logged in.'
[User id is:] null
[Page] /index-test.php/test/test
[Response] 200
[Request Cookies] []
[Response Headers] {"access-control-expose-headers":["X-Pagination-Total-Count, X-Pagination-Page-Count, X-Pagination-Current-Page, X-Pagination-Per-Page, token-type, access-token, userId"],"content-type":["application/json; charset=UTF-8"]}
[Response] []
PASSED
[Database] Transaction cancelled; all changes reverted.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Time: 383 ms, Memory: 24.00MB
OK (1 test, 0 assertions)
In the last query, I do not see the user id, but should
Details
Codeception version:
PHP Version: 7.2
Operating System: ubuntu 16.04
Installation type: Composer 1.5
List of installed package
behat/gherkin v4.4.5 Gherkin DSL parser for PHP 5.3
bower-asset/bootstrap v3.3.7 The most popular front-end framework for developing responsive, mobile first projects on the web.
bower-asset/jquery 2.2.4
bower-asset/jquery.inputmask 3.3.10 Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.
bower-asset/punycode v1.3.2
bower-asset/raven-js 3.12.2
bower-asset/typeahead.js v0.11.1
bower-asset/yii2-pjax 2.0.7.1
bshaffer/oauth2-server-php v1.9.0 OAuth2 Server for PHP
c006/yii2-migration-utility v2.0.2 Automatically writes the create tables for migrations or create tables in general
cebe/markdown 1.1.2 A super fast, highly extensible markdown parser for PHP
codeception/aspect-mock dev-master a30ff6a Experimental Mocking Framework powered by Aspects
codeception/base 2.3.5 BDD-style testing framework
codeception/specify 0.4.6 BDD code blocks for PHPUnit and Codeception
codeception/verify 0.3.3 BDD assertion library for PHPUnit
danhunsaker/bcmath v1.1.3 PHP bcmath as a static class, with several enhancements.
doctrine/annotations v1.5.0 Docblock Annotations Parser
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
elisdn/yii2-gii-fixture-generator 1.1.4 Fixture class generator for Gii module of Yii2 Framework.
ezyang/htmlpurifier v4.9.3 Standards compliant HTML filter written in PHP
filsh/yii2-oauth2-server 2.0.1 OAuth2 Server for PHP
firebase/php-jwt v5.0.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
fzaninotto/faker v1.7.1 Faker is a PHP library that generates fake data for you.
goaop/framework 2.1.2 Framework for aspect-oriented programming in PHP.
goaop/parser-reflection 1.4.0 Provides reflection information, based on raw source
guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
himiklab/yii2-recaptcha-widget 1.0.6 Yii2 Google reCAPTCHA widget
insolita/yii2-fixturegii 1.0.4 gii fixture helper - generate fixture classes; faker templates; fixture data files from table
insolita/yii2-validatorpack 0.0.2 ...
jakubledl/dissect v1.0.1 Lexing and parsing in pure PHP
livechat/api-client-php v1.1.1 Enables PHP applications to communicate with the LiveChat API.
mito/yii2-sentry 1.0.2 Yii 2 extension for Sentry
myclabs/deep-copy 1.6.1 Create deep copies (clones) of your objects
nikic/php-parser v3.1.1 A PHP parser written in PHP
pahanini/yii2-consolelog v2.0.4 Dumps log to console
pdepend/pdepend 2.5.0 Official version of pdepend to be handled with Composer
phar-io/manifest 1.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 1.0.1 Library for handling version information and constraints
php-amqplib/php-amqplib v2.6.0 This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.
php-curl-class/php-curl-class 5.1.0 PHP Curl Class is an object-oriented wrapper of the PHP cURL extension.
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 4.1.1 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver 0.4.0
phploc/phploc 4.0.0 A tool for quickly measuring the size of a PHP project.
phpmd/phpmd 2.6.0 PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.
phpspec/php-diff v1.1.0 A comprehensive library for generating differences between two hashable objects (strings or arrays).
phpspec/phpspec 3.4.2 Specification-oriented BDD framework for PHP 5.6+
phpspec/prophecy v1.7.2 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 5.2.2 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.2 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 2.0.1 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 6.2.4 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 4.0.4 Mock Object library for PHPUnit
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.2 Common interface for logging libraries
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 2.0.0 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.3 Diff implementation
sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
sebastian/finder-facade 1.2.1 FinderFacade is a convenience wrapper for Symfony's Finder component.
sebastian/global-state 2.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
sebastian/phpcpd 2.0.4 Copy/Paste Detector (CPD) for PHP code.
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
sentry/sentry 1.6.2 A PHP client for Sentry (http://getsentry.com)
sonata-project/google-authenticator 2.0.0 Library to integrate Google Authenticator into a PHP project
squizlabs/php_codesniffer 3.1.1 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
stecman/symfony-console-completion 0.7.0 Automatic BASH completion for Symfony Console Component based applications.
swiftmailer/swiftmailer v5.4.8 Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit v3.3.10 Symfony BrowserKit Component
symfony/config v3.3.10 Symfony Config Component
symfony/console v3.3.10 Symfony Console Component
symfony/css-selector v3.3.10 Symfony CssSelector Component
symfony/debug v3.3.10 Symfony Debug Component
symfony/dependency-injection v3.3.10 Symfony DependencyInjection Component
symfony/dom-crawler v3.3.10 Symfony DomCrawler Component
symfony/event-dispatcher v3.3.10 Symfony EventDispatcher Component
symfony/filesystem v3.3.10 Symfony Filesystem Component
symfony/finder v3.3.10 Symfony Finder Component
symfony/polyfill-mbstring v1.6.0 Symfony polyfill for the Mbstring extension
symfony/process v3.3.10 Symfony Process Component
symfony/yaml v3.3.10 Symfony Yaml Component
theseer/fdomdocument 1.6.6 The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add vari...
theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and potentially other formats
videlalvaro/php-amqplib v2.4.0 This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.
vlucas/phpdotenv v2.4.0 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
webmozart/assert 1.2.0 Assertions to validate method input/output with nice error messages.
webtoucher/yii2-amqp v1.0.0 Yii 2 extension wrapper to communicate with RabbitMQ server via AMQP. Based on videlalvaro/php-amqplib.
webtoucher/yii2-commands v1.0.3 Yii 2 extension wrapper for console controllers.
yiisoft/yii2 2.0.12 Yii PHP Framework Version 2
yiisoft/yii2-bootstrap 2.0.7 The Twitter Bootstrap extension for the Yii framework
yiisoft/yii2-composer 2.0.5 The composer plugin for Yii extension installer
yiisoft/yii2-debug 2.0.12 The debugger extension for the Yii framework
yiisoft/yii2-faker 2.0.3 Fixture generator. The Faker integration for the Yii framework.
yiisoft/yii2-gii 2.0.5 The Gii extension for the Yii framework
yiisoft/yii2-mongodb 2.1.4 MongoDB extension for the Yii framework
yiisoft/yii2-redis 2.0.6 Redis Cache, Session and ActiveRecord for the Yii framework
yiisoft/yii2-swiftmailer 2.0.7 The SwiftMailer integration for the Yii framework
* Suite configuration:
```yml
# Codeception Test Suite Configuration
# suite for functional (integration) tests.
# emulate web requests and make application process them.
# (tip: better to use with frameworks).
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
#basic/web/index.php
class_name: FunctionalTester
modules:
enabled:
- Asserts
- Yii2
- REST:
depends: Yii2
url:
config:
Yii2:
configFile: 'config/tests/functional.php'
cleanup: true # don't wrap test in transaction
What are you trying to achieve?
Mock user in functional test
Action code
In the last query, I do not see the user id, but should
Details