lucatume / rest-calculator

1 stars 0 forks source link

running functional tests returns 500 internal server error instead of 200 #1

Open arun160411 opened 7 years ago

arun160411 commented 7 years ago

Hi,

i am new to php and codeception. im trying to run the functional tests of this project in my local machine and the tests would fail while asserting 200 server response. the response seems to be 500. tried hard to figure out why, but couldn't. could you let me know the reason.

im using MAMP and configured Functional.yml file according to my local settings.

class_name: FunctionalTester modules: enabled:

arun160411 commented 7 years ago

here is the test and below the failure

<?php namespace Tests\Functional; class AddRequestCest { /**

Codeception PHP Testing Framework v2.2.11 Powered by PHPUnit 5.7.19 by Sebastian Bergmann and contributors.

Running as single site

Functional Tests (1) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Modules: \Helper\Functional, Filesystem, WPDb, WordPress, WPLoader

AddRequestCest: Return_the_correct_result | 5,4 Signature: Tests\Functional\AddRequestCest:return_the_correct_result Test: tests/functional/AddRequestCest.php:return_the_correct_result Scenario -- I am on page "/" [Cookie Jar] ["wordpress_test_cookie=WP+Cookie+check; path=/; httponly"] [Request Headers] [] [Page] / [Response] 500 [Request Cookies] {"wordpress_test_cookie":"WP Cookie check"} [Response Headers] {"Content-type":"text/html; charset=UTF-8","Set-Cookie":["wordpress_test_cookie=WP Cookie check"]} I see response code is 200 FAIL


Time: 1.62 seconds, Memory: 30.00MB

There was 1 failure:


1) AddRequestCest: Return_the_correct_result | 5,4 Test tests/functional/AddRequestCest.php:return_the_correct_result Step See response code is 200 Fail Expected HTTP Status Code: 200 (OK). Actual Status Code: 500 (Internal Server Error) Failed asserting that 500 matches expected 200.

Scenario Steps:

  1. $I->seeResponseCodeIs(200) at tests/functional/AddRequestCest.php:18
  2. $I->amOnPage("/") at tests/functional/AddRequestCest.php:16

FAILURES! Tests: 1, Assertions: 1, Failures: 1.