{"action":"created","issue":{"url":"https://api.github.com/repos/lucatume/wp-browser/issues/68","repository_url":"https://api.github.com/repos/lucatume/wp-browser","labels_url":"https://api.github.com/repos/lucatume/wp-browser/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/lucatume/wp-browser/issues/68/comments","events_url":"https://api.github.com/repos/lucatume/wp-browser/issues/68/events","html_url":"https://github.com/lucatume/wp-browser/issues/68","id":220057480,"number":68,"title":"WordPress module doesn't load WordPress code","user":{"login":"grulex","id":7621534,"avatar_url":"https://avatars1.githubusercontent.com/u/7621534?v=3","gravatar_id":"","url":"https://api.github.com/users/grulex","html_url":"https://github.com/grulex","followers_url":"https://api.github.com/users/grulex/followers","following_url":"https://api.github.com/users/grulex/following{/other_user}","gists_url":"https://api.github.com/users/grulex/gists{/gist_id}","starred_url":"https://api.github.com/users/grulex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grulex/subscriptions","organizations_url":"https://api.github.com/users/grulex/orgs","repos_url":"https://api.github.com/users/grulex/repos","events_url":"https://api.github.com/users/grulex/events{/privacy}","received_events_url":"https://api.github.com/users/grulex/received_events","type":"User","site_admin":false},"labels":[{"id":107282453,"url":"https://api.github.com/repos/lucatume/wp-browser/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-06T22:56:02Z","updated_at":"2017-04-07T12:49:47Z","closed_at":null,"body":"I have enabled and configured `WordPress` and `WPDb` modules. However, the following test fails and says that `is_admin()` is undefined. Same with any other WordPress function. I'm sure `WPDb` is configured correctly. And there isn't much to configure for the `WordPress` module.\r\n\r\n`class MyTest extends \\Codeception\\Test\\Unit {`\r\n`public function testMe() {`\r\n`$this->assertFalse(is_admin());`\r\n`}`\r\n`}`\r\n\r\nBy the way, the test works when I use `WPLoader` module instead of those two.\r\n\r\nIf this is not a bug and everything works as expected, please consider writing a better high-level summary of what each module, including `WordPress`, is supposed to do. It's a bit confusing at the moment."},"comment":{"url":"https://api.github.com/repos/lucatume/wp-browser/issues/comments/292527645","html_url":"https://github.com/lucatume/wp-browser/issues/68#issuecomment-292527645","issue_url":"https://api.github.com/repos/lucatume/wp-browser/issues/68","id":292527645,"user":{"login":"grulex","id":7621534,"avatar_url":"https://avatars1.githubusercontent.com/u/7621534?v=3","gravatar_id":"","url":"https://api.github.com/users/grulex","html_url":"https://github.com/grulex","followers_url":"https://api.github.com/users/grulex/followers","following_url":"https://api.github.com/users/grulex/following{/other_user}","gists_url":"https://api.github.com/users/grulex/gists{/gist_id}","starred_url":"https://api.github.com/users/grulex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grulex/subscriptions","organizations_url":"https://api.github.com/users/grulex/orgs","repos_url":"https://api.github.com/users/grulex/repos","events_url":"https://api.github.com/users/grulex/events{/privacy}","received_events_url":"https://api.github.com/users/grulex/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T12:49:47Z","updated_at":"2017-04-07T12:49:47Z","body":"Thanks for your quick reply. That example was obviously not a real test. I just wanted to show that WordPress functions are not available when only `WordPress` module is used. This seems to go against what you're saying in your description: \"it will load WordPress code in the same variable scope as the tests\". This is what confused me in the first place.\r\n\r\nAnd I still don't quite understand what the **purpose** of the `WordPress` module is. Why would someone use it instead of `WPBrowser` or `WPWebDriver`? Is it faster perhaps?"}}
{"actor":{"display_login":"grulex"}}