{"id":36279153,"url":"https://github.com/damianlewis/oc-octobertesting-plugin","last_synced_at":"2026-01-11T09:01:37.429Z","repository":{"id":56961556,"uuid":"168560222","full_name":"damianlewis/oc-octobertesting-plugin","owner":"damianlewis","description":"Enables OctoberCMS to use Laravel's testing frameworks","archived":false,"fork":false,"pushed_at":"2019-10-15T12:45:23.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-28T12:43:25.020Z","etag":null,"topics":["octobercms","octobercms-plugin","testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damianlewis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-31T16:49:09.000Z","updated_at":"2024-04-28T12:43:25.021Z","dependencies_parsed_at":"2022-08-21T05:10:21.544Z","dependency_job_id":null,"html_url":"https://github.com/damianlewis/oc-octobertesting-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/damianlewis/oc-octobertesting-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damianlewis%2Foc-octobertesting-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damianlewis%2Foc-octobertesting-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damianlewis%2Foc-octobertesting-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damianlewis%2Foc-octobertesting-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damianlewis","download_url":"https://codeload.github.com/damianlewis/oc-octobertesting-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damianlewis%2Foc-octobertesting-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28298875,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["octobercms","octobercms-plugin","testing"],"created_at":"2026-01-11T09:01:06.591Z","updated_at":"2026-01-11T09:01:37.413Z","avatar_url":"https://github.com/damianlewis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# October Testing\nEnables the use of the Laravel testing frameworks within October CMS.\n\n## Usage\n\n### Installation\nInstall via Composer:\n```bash\ncomposer require damianlewis/oc-octobertesting-plugin --dev\n```\n\n### Plugin Feature \u0026 Unit Tests\nTo test plugins, create a `tests` folder within the plugin base folder and copy the `phpunit.xml` file to this location, for example, `/plugins/acme/blog/tests/phpunit.xml`. Create sub folders for feature and unit tests, for example, `/plugins/acme/blog/tests/feature/` and `/plugins/acme/blog/tests/unit/`. Then in the tests folders, create tests following the principles used for [Laravel testing](https://laravel.com/docs/5.5/testing). Test suites have been configured within the `phpunit.xml` file for feature and unit tests.\n\nWhen creating tests, use the alternative `Tests\\PluginTestCase` class. This alternative class doesn't make use of an in memory database, allowing you to choose what database you wish to use for testing. See example below.\n```php\n\u003c?php\n\nnamespace Acme\\Blog\\Tests\\Feature;\n\nuse Tests\\PluginTestCase;\n\nclass ExampleTest extends PluginTestCase\n{\n    /**\n     * A basic test example.\n     *\n     * @return void\n     */\n    public function testBasicTest()\n    {\n        $response = $this-\u003eget('/');\n\n        $response-\u003eassertStatus(200);\n    }\n}\n```\n\n### Laravel Dusk\nTo make use of Laravel Dusk with OctoberCMS, run the `dusk:install` Artisan command:\n```bash\nphp artisan dusk:install\n```\n\nThen use Dusk as you would with Laravel, see [Laravel Dusk](https://laravel.com/docs/5.5/dusk#installation). For example, to run tests from the CLI use the `dusk` Artisan command:\n```bash\nphp artisan dusk\n```\n\n#### Authentication\nTo make use of the `login` and `loginAs` authentication methods, an object containing the `login` and `password` for the user is expected. To provide the default/admin user account, you can override the `user` method in the `Tests\\DuskTestCase` class as follows:\n```php\n\u003c?php\n\nnamespace Tests;\n\nuse Laravel\\Dusk\\TestCase as BaseTestCase;\nuse Facebook\\WebDriver\\Chrome\\ChromeOptions;\nuse Facebook\\WebDriver\\Remote\\RemoteWebDriver;\nuse Facebook\\WebDriver\\Remote\\DesiredCapabilities;\n\nabstract class DuskTestCase extends BaseTestCase\n{\n    use CreatesApplication;\n    \n    ...\n    \n    protected function user()\n    {\n        return (object)[\n            'login' =\u003e 'admin',\n            'password' =\u003e 'admin'\n        ];\n    }\n}\n```\n\n#### Screenshots\nTo create browser screenshots add the `--window-size` argument to the `ChromeOptions-\u003eaddArguments` method as shown below:\n```php\n$options = (new ChromeOptions)-\u003eaddArguments([\n    '--disable-gpu',\n    '--window-size=1280,1024',\n    '--headless'\n]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamianlewis%2Foc-octobertesting-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamianlewis%2Foc-octobertesting-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamianlewis%2Foc-octobertesting-plugin/lists"}