Skip to content

json_encode(): type is unsupported, encoded as null #1165

@adamski

Description

@adamski

When trying to run any test I get the following error:

json_encode(): type is unsupported, encoded as null

I'm using v 2.0.1

Example output below:

Trying to get a list of all users (GetUsersCept)
Scenario

  • I have http header "Content-Type","application/x-www-form-urlencoded"

  • I send get "users"
    [Request] GET http://api.myapp.com/users
    ERROR

    [ErrorException]
    json_encode(): type is unsupported, encoded as null

Exception trace:
() at /app-dir/vendor/phpunit/phpunit/src/Util/Log/JSON.php:280
Codeception\Subscriber\ErrorHandler->errorHandler() at n/a:n/a
json_encode() at /app-dir/vendor/phpunit/phpunit/src/Util/Log/JSON.php:280
PHPUnit_Util_Log_JSON->write() at /app-dir/vendor/phpunit/phpunit/src/Util/Log/JSON.php:266
PHPUnit_Util_Log_JSON->writeCase() at /app-dir/vendor/phpunit/phpunit/src/Util/Log/JSON.php:94
PHPUnit_Util_Log_JSON->addError() at /app-dir/vendor/phpunit/phpunit/src/Framework/TestResult.php:275
PHPUnit_Framework_TestResult->addError() at /app-dir/vendor/phpunit/phpunit/src/Framework/TestResult.php:760
PHPUnit_Framework_TestResult->run() at /app-dir/vendor/phpunit/phpunit/src/Framework/TestCase.php:753
PHPUnit_Framework_TestCase->run() at /app-dir/vendor/phpunit/phpunit/src/Framework/TestSuite.php:675
PHPUnit_Framework_TestSuite->run() at /app-dir/vendor/codeception/codeception/src/Codeception/PHPUnit/Runner.php:100
Codeception\PHPUnit\Runner->doEnhancedRun() at /app-dir/vendor/codeception/codeception/src/Codeception/SuiteManager.php:153
Codeception\SuiteManager->run() at /app-dir/vendor/codeception/codeception/src/Codeception/Codecept.php:167
Codeception\Codecept->runSuite() at /app-dir/vendor/codeception/codeception/src/Codeception/Codecept.php:150
Codeception\Codecept->run() at /app-dir/vendor/codeception/codeception/src/Codeception/Command/Run.php:198
Codeception\Command\Run->runSuites() at /app-dir/vendor/codeception/codeception/src/Codeception/Command/Run.php:149
Codeception\Command\Run->execute() at /app-dir/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
Symfony\Component\Console\Command\Command->run() at /app-dir/vendor/symfony/console/Symfony/Component/Console/Application.php:887
Symfony\Component\Console\Application->doRunCommand() at /app-dir/vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at /app-dir/vendor/symfony/console/Symfony/Component/Console/Application.php:124
Symfony\Component\Console\Application->run() at /app-dir/vendor/codeception/codeception/codecept:27

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions