1

I'm trying to get code coverage for my unit tests with codeception.

When i'm doing vendor/bin/codecept run unit --coverage it displays that :

  Classes:  0.00% (0/1) 
  Methods:  0.00% (0/3) 
  Lines:    0.00% (0/28)

Although I have tested 1 method over 3.

I have xdebug installed with coverage_enable=On

Here is my codeception.yml config file :

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:
        Db:
            dsn: ''
            user: ''
            password: ''
            dump: tests/_data/dump.sql
coverage:
    enable: true
    remote: false
    include:
        - Simplifier/*
    exclude:
        - vendor/*

I'm trying to test Simplifier/Routing.php

The test is OK, but my coverage is wrong.

Any idea why ?

Thanks.

1 Answer 1

3

You made a mistake in setting name.

Change enable: true to enabled: true and code coverage collection will work.
http://codeception.com/docs/11-Codecoverage#Configuration

Sign up to request clarification or add additional context in comments.

1 Comment

It had to come back 3 times to this answer to finally recognize what the difference is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.