{"action":"created","issue":{"url":"https://api.github.com/repos/octobercms/october/issues/2592","repository_url":"https://api.github.com/repos/octobercms/october","labels_url":"https://api.github.com/repos/octobercms/october/issues/2592/labels{/name}","comments_url":"https://api.github.com/repos/octobercms/october/issues/2592/comments","events_url":"https://api.github.com/repos/octobercms/october/issues/2592/events","html_url":"https://github.com/octobercms/october/issues/2592","id":198883951,"number":2592,"title":"Plugin test can't boot up boot method","user":{"login":"surahmans","id":8978940,"avatar_url":"https://avatars.githubusercontent.com/u/8978940?v=3","gravatar_id":"","url":"https://api.github.com/users/surahmans","html_url":"https://github.com/surahmans","followers_url":"https://api.github.com/users/surahmans/followers","following_url":"https://api.github.com/users/surahmans/following{/other_user}","gists_url":"https://api.github.com/users/surahmans/gists{/gist_id}","starred_url":"https://api.github.com/users/surahmans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/surahmans/subscriptions","organizations_url":"https://api.github.com/users/surahmans/orgs","repos_url":"https://api.github.com/users/surahmans/repos","events_url":"https://api.github.com/users/surahmans/events{/privacy}","received_events_url":"https://api.github.com/users/surahmans/received_events","type":"User","site_admin":false},"labels":[{"id":67885483,"url":"https://api.github.com/repos/octobercms/october/labels/Type:%20Question","name":"Type: Question","color":"cc317c","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-01-05T06:16:43Z","updated_at":"2017-01-31T21:43:47Z","closed_at":"2017-01-12T18:56:24Z","body":"##### Expected behavior\r\nI want to test my plugin using `TestCase` instead of `PluginTestCase`. I add dynamic method using `addDynamicMethod` on plugin boot method, and hope it works by calling `$user->subscibe($plan)`\r\n\r\n##### Actual behavior\r\nI get this error:\r\n```\r\n1) Indovisual\\Membership\\Tests\\Unit\\SubscriptionTest::user_can_subrcribe_a_plan\r\nBadMethodCallException: Call to undefined method October\\Rain\\Database\\QueryBuilder::subscribe()\r\n```\r\n\r\nBut when I adding the `subscribe` method directly to model it works.\r\n\r\n##### Reproduce steps\r\nHere's my code to extend the `User model`:\r\n```\r\n            $model->addDynamicMethod('subscribe', function($plan) use ($model) {\r\n                if ($plan instanceof \\Indovisual\\Membership\\Models\\Plan) {\r\n                    return $model->subscribes()->save($plan);\r\n                }\r\n            });\r\n```\r\n\r\n##### October build\r\nv350\r\n"},"comment":{"url":"https://api.github.com/repos/octobercms/october/issues/comments/276502245","html_url":"https://github.com/octobercms/october/issues/2592#issuecomment-276502245","issue_url":"https://api.github.com/repos/octobercms/october/issues/2592","id":276502245,"user":{"login":"daftspunk","id":1392869,"avatar_url":"https://avatars.githubusercontent.com/u/1392869?v=3","gravatar_id":"","url":"https://api.github.com/users/daftspunk","html_url":"https://github.com/daftspunk","followers_url":"https://api.github.com/users/daftspunk/followers","following_url":"https://api.github.com/users/daftspunk/following{/other_user}","gists_url":"https://api.github.com/users/daftspunk/gists{/gist_id}","starred_url":"https://api.github.com/users/daftspunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daftspunk/subscriptions","organizations_url":"https://api.github.com/users/daftspunk/orgs","repos_url":"https://api.github.com/users/daftspunk/repos","events_url":"https://api.github.com/users/daftspunk/events{/privacy}","received_events_url":"https://api.github.com/users/daftspunk/received_events","type":"User","site_admin":false},"created_at":"2017-01-31T21:43:47Z","updated_at":"2017-01-31T21:43:47Z","body":"Very interesting, I'm not sure why it should happen because for all intents and purposes the code is identical."}}
{"actor":{"display_login":"daftspunk"}}