Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function #23

Closed
stefthoen opened this issue Jun 9, 2017 · 1 comment
Closed

Call to undefined function #23

stefthoen opened this issue Jun 9, 2017 · 1 comment

Comments

@stefthoen
Copy link

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.

@danielbachhuber
Copy link
Member

Hi @stefthoen,

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

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

No branches or pull requests

2 participants