Skip to content

Commit

Permalink
fix db getter of fixture command closes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Apr 22, 2020
1 parent 64692f3 commit 55442ea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

## 1.0.30 (22. April 2020)

+ [#33](https://github.com/luyadev/luya-testsuite/issues/33) Fix issue with lazy loading of testsuite console command.
+ [#35](https://github.com/luyadev/luya-testsuite/pull/35) New DummyMenu Component for LUYA CMS in order to build menu items more quickly.

## 1.0.29 (7. April 2020)
Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Bootstrap implements BootstrapInterface
*/
public function bootstrap($app)
{
if ($app instanceof Application) {
if ($app instanceof Application && $app->enableCoreCommands) {
$app->controllerMap['generatefixture'] = [
'class' => GenerateFixtureController::class,
];
Expand Down
24 changes: 20 additions & 4 deletions src/commands/GenerateFixtureController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* Generate Fixtures.
*
* @property Connection $db The db component.
*
* @since 1.0.25
* @author Basil Suter <[email protected]>
*/
Expand Down Expand Up @@ -48,13 +50,27 @@ class GenerateFixtureController extends Command
*/
public $data;

private $_db = 'db';


/**
* {@inheritDoc}
* DB Component Setter
*
* @param string $db
*/
public function setDb($db)
{
$this->_db = $db;
}

/**
* DB Component Getter
*
* @return Connection
*/
public function init()
public function getDb()
{
parent::init();
$this->db = Instance::ensure($this->db, Connection::class);
return Instance::ensure($this->_db, Connection::class);
}

/**
Expand Down

0 comments on commit 55442ea

Please sign in to comment.