Skip to content

Unexpected methods counter "0" after change config #43

@bscheshirwork

Description

@bscheshirwork

For yii2-app-advanced

I rm modules from
common/tests/unit.suite.yml

class_name: UnitTester
bootstrap: false

build throw docker codecep image

root@72603fb8df51:/var/www/html# codecept build

Included Configuration: common
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
common\tests\AcceptanceTester includes modules: 
 -> FunctionalTesterActions.php generated successfully. 0 methods added
common\tests\FunctionalTester includes modules: 
 -> UnitTesterActions.php generated successfully. 0 methods added
common\tests\UnitTester includes modules: 

Included Configuration: frontend
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
frontend\tests\AcceptanceTester includes modules: WebDriver, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, Asserts, common\tests\Helper\Acceptance
 -> FunctionalTesterActions.php generated successfully. 0 methods added
frontend\tests\FunctionalTester includes modules: Filesystem, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, Asserts, common\tests\Helper\Functional, frontend\tests\Helper\Functional
 -> UnitTesterActions.php generated successfully. 0 methods added
frontend\tests\UnitTester includes modules: Yii2, Asserts

Included Configuration: backend
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
backend\tests\AcceptanceTester includes modules: WebDriver, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, common\tests\Helper\Acceptance
 -> FunctionalTesterActions.php generated successfully. 0 methods added
backend\tests\FunctionalTester includes modules: \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, common\tests\Helper\Functional
 -> UnitTesterActions.php generated successfully. 0 methods added
backend\tests\UnitTester includes modules: 

I can see in generated code is 1 method

<?php  //[STAMP] 739f27113b6e852d226d2e121e177b1d
namespace common\tests\_generated;

// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile

trait UnitTesterActions
{
    /**
     * @return \Codeception\Scenario
     */
    abstract protected function getScenario();

    
}

I add more modules to common/tests/unit.suite.yml

class_name: UnitTester
bootstrap: false
modules:
    enabled:
        - Yii2:
            part: fixtures
        - Asserts

I build again

root@72603fb8df51:/var/www/html# codecept build

Included Configuration: common
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
common\tests\AcceptanceTester includes modules: 
 -> FunctionalTesterActions.php generated successfully. 0 methods added
common\tests\FunctionalTester includes modules: 
 -> UnitTesterActions.php generated successfully. 0 methods added
common\tests\UnitTester includes modules: Yii2, Asserts

Included Configuration: frontend
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
frontend\tests\AcceptanceTester includes modules: WebDriver, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, Asserts, common\tests\Helper\Acceptance
 -> FunctionalTesterActions.php generated successfully. 0 methods added
frontend\tests\FunctionalTester includes modules: Filesystem, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, Asserts, common\tests\Helper\Functional, frontend\tests\Helper\Functional
 -> UnitTesterActions.php generated successfully. 0 methods added
frontend\tests\UnitTester includes modules: Yii2, Asserts

Included Configuration: backend
Building Actor classes for suites: acceptance, functional, unit
 -> AcceptanceTesterActions.php generated successfully. 0 methods added
backend\tests\AcceptanceTester includes modules: WebDriver, \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, common\tests\Helper\Acceptance
 -> FunctionalTesterActions.php generated successfully. 0 methods added
backend\tests\FunctionalTester includes modules: \bscheshirwork\Codeception\Module\DbYii2Config, Yii2, common\tests\Helper\Functional
 -> UnitTesterActions.php generated successfully. 0 methods added
backend\tests\UnitTester includes modules: 

I can see in common/tests/_support/_generated/UnitTesterActions.php 38 methods

What are you trying to achieve?

 -> UnitTesterActions.php generated successfully. 37 methods added
common\tests\UnitTester includes modules: Yii2, Asserts

What do you get instead?

 -> UnitTesterActions.php generated successfully. 0 methods added
common\tests\UnitTester includes modules: Yii2, Asserts

Details

  • Codeception version: Codeception 2.3.6
  • PHP Version: 7.2.0
  • Operating System: Debian Scratch
  • Installation type: Composer
  • List of installed packages (composer show)
root@72603fb8df51:/repo# composer show
behat/gherkin                            v4.4.5 Gherkin DSL parser for PHP 5.3
bscheshirwork/codeception-db-yii2-config v1.1   Connection 'Db' codeception module to 'Yii2' module database settings
codeception/specify                      0.4.6  BDD code blocks for PHPUnit and Codeception
codeception/verify                       1.0.0  BDD assertion library for PHPUnit
doctrine/instantiator                    1.1.0  A small, lightweight utility to instantiate objects in PHP without invoking their constructors
facebook/graph-sdk                       5.6.1  Facebook SDK for PHP
facebook/webdriver                       1.5.0  A PHP client for Selenium WebDriver
flow/jsonpath                            0.3.4  JSONPath implementation for parsing, searching and flattening arrays
fzaninotto/faker                         v1.5.0 Faker is a PHP library that generates fake data for you.
guzzlehttp/guzzle                        6.3.0  Guzzle is a PHP HTTP client library
guzzlehttp/promises                      v1.3.1 Guzzle promises library
guzzlehttp/psr7                          1.4.2  PSR-7 message implementation that also provides common utility methods
league/factory-muffin                    v3.0.1 The goal of this package is to enable the rapid creation of objects for the purpose of testing.
league/factory-muffin-faker              v1.0.0 The goal of this package is to wrap faker to make it super easy to use with factory muffin.
monolog/monolog                          1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy                        1.7.0  Create deep copies (clones) of your objects
pda/pheanstalk                           v3.1.0 PHP client for beanstalkd queue
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.7.0 Formerly videlalvaro/php-amqplib.  This library is a pure PHP implementation of the AMQP protocol. It's been tested against RabbitMQ.
phpdocumentor/reflection-common          1.0.1  Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock        4.2.0  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 
phpspec/prophecy                         1.7.3  Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage                5.3.0  Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator                1.4.5  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.2  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
predis/predis                            v1.1.1 Flexible and feature-complete Redis client for PHP and HHVM
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/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/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
squizlabs/php_codesniffer                2.9.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.
symfony/browser-kit                      v3.4.1 Symfony BrowserKit Component
symfony/console                          v3.4.1 Symfony Console Component
symfony/css-selector                     v3.4.1 Symfony CssSelector Component
symfony/debug                            v4.0.1 Symfony Debug Component
symfony/dom-crawler                      v3.4.1 Symfony DomCrawler Component
symfony/event-dispatcher                 v3.4.1 Symfony EventDispatcher Component
symfony/finder                           v3.4.1 Symfony Finder Component
symfony/polyfill-mbstring                v1.6.0 Symfony polyfill for the Mbstring extension
symfony/process                          v3.4.1 Symfony Process Component
symfony/yaml                             v3.4.1 Symfony Yaml Component
theseer/tokenizer                        1.1.0  A small library for converting tokenized PHP source code into XML and potentially other formats
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.
root@72603fb8df51:/repo# 
  • Suite configuration:
    global
# global codeception file to run tests from all apps
include:
    - common
    - frontend
    - backend
paths:
    log: console/runtime/logs
settings:
    colors: true
coverage:
    enabled: true

common

namespace: common\tests
actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
extensions:
    enabled:
        - Codeception\Extension\RunFailed
modules:
    config:
        Yii2:
            configFile: 'config/test-local.php'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions