Skip to content

Conversation

@daithi-coombes
Copy link

This pr is to fix: cant run with phpunit: PHP Warning: headers already sent by (output started at bootstrap.php:53) pluggable.php on line 1196 .

I've found that the main issue that was causing my plugin unit tests to fail was the use of php setcookies() function writing headers(), to solve this I created a reduxCookie class that I could mock or overwrite in my unit tests.

I've also added the following to the pr:

  • composer version number 8a94c53
  • unit testing instructions in condributing.md cb7b9f2
  • reduxCookie class 3193533

@kprovance
Copy link
Member

Instead of adding a new file for the static setcookie function, I'm going to add it into our functions class instead. Plus, we're a few versions ahead of .1. I will credit you accordingly. :-)

@daithi-coombes
Copy link
Author

@kprovance cheers ;)

if it helps - I think that build fail is from me checking the flag WP_TESTS_DOMAIN to prevent printing to stdout when running tests: here

@kprovance
Copy link
Member

Added to upcoming push! ;-)

@kprovance kprovance closed this Apr 30, 2015
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
kprovance added a commit that referenced this pull request Apr 30, 2015
Signed-off-by:KProvance <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cant run with phpunit: PHP Warning: headers already sent by (output started at bootstrap.php:53) pluggable.php on line 1196

2 participants