{"action":"opened","issue":{"url":"https://api.github.com/repos/teamtnt/laravel-scout-tntsearch-driver/issues/4","repository_url":"https://api.github.com/repos/teamtnt/laravel-scout-tntsearch-driver","labels_url":"https://api.github.com/repos/teamtnt/laravel-scout-tntsearch-driver/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/teamtnt/laravel-scout-tntsearch-driver/issues/4/comments","events_url":"https://api.github.com/repos/teamtnt/laravel-scout-tntsearch-driver/issues/4/events","html_url":"https://github.com/teamtnt/laravel-scout-tntsearch-driver/issues/4","id":172006943,"number":4,"title":"Undefined var username when testing against an sqlite database","user":{"login":"talv86","id":7305131,"avatar_url":"https://avatars.githubusercontent.com/u/7305131?v=3","gravatar_id":"","url":"https://api.github.com/users/talv86","html_url":"https://github.com/talv86","followers_url":"https://api.github.com/users/talv86/followers","following_url":"https://api.github.com/users/talv86/following{/other_user}","gists_url":"https://api.github.com/users/talv86/gists{/gist_id}","starred_url":"https://api.github.com/users/talv86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talv86/subscriptions","organizations_url":"https://api.github.com/users/talv86/orgs","repos_url":"https://api.github.com/users/talv86/repos","events_url":"https://api.github.com/users/talv86/events{/privacy}","received_events_url":"https://api.github.com/users/talv86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-18T21:36:36Z","updated_at":"2016-08-18T21:36:36Z","closed_at":null,"body":"I'm trying to run unit tests against an sqlite database in memory with the following credentials:\r\n\r\n```\r\n[\r\n            'driver'   => 'sqlite',\r\n            'database' => ':memory:',\r\n            'prefix'   => '',\r\n            'strict'   => false,\r\n]\r\n```\r\n\r\nHowever when I run them i get the following error:\r\n\r\n```\r\nErrorException: Undefined variable: username in /home/talv/Projects/easel/vendor/teamtnt/tntsearch/src/Connectors/Connector.php:46\r\n```\r\nThe problem arises from the extract  function not having a `$username` and `$password` keys to extract:\r\n```\r\n    public function createConnection($dsn, array $config, array $options)\r\n    {\r\n        extract($config, EXTR_SKIP);\r\n\r\n        return new PDO($dsn, $username, $password, $options);\r\n\r\n    }\r\n```\r\n\r\nI then created 2 null values within my database connection for username and password and it got passed the connector part however it brings the following errors\r\n\r\n````\r\nPDOException: SQLSTATE[HY000]: General error: 1 no such table: posts in /home/talv/Projects/easel/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php:173\r\nStack trace:\r\n#0 /home/talv/Projects/easel/vendor/teamtnt/tntsearch/src/Indexer/TNTIndexer.php(173): PDO->query('SELECT id, titl...')\r\n#1 /home/talv/Projects/easel/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(167): TeamTNT\\TNTSearch\\Indexer\\TNTIndexer->run()\r\n#2 /home/talv/Projects/easel/vendor/teamtnt/laravel-scout-tntsearch-driver/src/Engines/TNTSearchEngine.php(33): TeamTNT\\Scout\\Engines\\TNTSearchEngine->initIndex(Object(Easel\\Models\\Post))\r\n#3 /home/talv/Projects/easel/vendor/laravel/scout/src/Searchable.php(41): TeamTNT\\Scout\\Engines\\TNTSearchEngine->update(Object(Illuminate\\Database\\Eloquent\\Collection))\r\n#4 /home/talv/Projects/easel/vendor/laravel/scout/src/Searchable.php(24): Easel\\Models\\Tag->queueMakeSearchable(Object(Illuminate\\Database\\Eloquent\\Collection))\r\n#5 [internal function]: Illuminate\\Database\\Eloquent\\Collection->Laravel\\Scout\\{closure}()\r\n#6 /home/talv/Projects/easel/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php(78): call_user_func_array(Object(Closure), Array)\r\n#7 /home/talv/Projects/easel/vendor/laravel/scout/src/Searchable.php(87): Illuminate\\Support\\Collection->__call('searchable', Array)\r\n#8 /home/talv/Projects/easel/vendor/laravel/scout/src/ModelObserver.php(61): Easel\\Models\\Post->searchable()\r\n#9 [internal function]: Laravel\\Scout\\ModelObserver->created(Object(Easel\\Models\\Post))\r\n.....\r\n```\r\n\r\nIt seems thats the migrations to create the tables break with the introduction of username and password keys for the sqlite databases in memory. \r\n\r\nAny ideas on how to fix the above?\r\n\r\nRemoving the tests for searching allows all my tests to work as normal."}}
{"actor":{"display_login":"talv86"}}