You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the last couple of days I've been trying to get tests to work in themes. I test with a new theme with just a index.php, a style.css and a functions.php file. I have this function in functions.php:
function test_theme() {
return 'hi';
}
And my test:
function test_sample() {
// Replace this with some actual testing code.
$this->assertTrue( true );
$this->assertEquals( 'hi', test_theme() );
}
When I run the test, PHPUnit gives an error:
There was 1 error:
1) SampleTest::test_sample
Error: Call to undefined function test_theme()
Is there something simple I'm overlooking? For any debug info about my setup/system, please see #22.
The text was updated successfully, but these errors were encountered:
GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. Bug reports need to be reproducible with a fresh WordPress install. If your issue only reproduces in your environment, then it's likely specific to your environment. For support options, please review http://wp-cli.org/#support
For the last couple of days I've been trying to get tests to work in themes. I test with a new theme with just a
index.php
, astyle.css
and afunctions.php
file. I have this function infunctions.php
:And my test:
When I run the test, PHPUnit gives an error:
Is there something simple I'm overlooking? For any debug info about my setup/system, please see #22.
The text was updated successfully, but these errors were encountered: