-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added support for dropAnalyzers, dropGraphs and dropAll to Test…
…Case
- Loading branch information
1 parent
863750e
commit f7932ef
Showing
6 changed files
with
83 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace LaravelFreelancerNL\Aranguent\Testing\Concerns; | ||
|
||
trait CanConfigureMigrationCommands | ||
{ | ||
/** | ||
* Determine if types should be dropped when refreshing the database. | ||
* | ||
* @return array<string, array<string>|string> | ||
*/ | ||
protected function setMigrationPaths() | ||
{ | ||
$migrationSettings = []; | ||
|
||
if (property_exists($this, 'realPath')) { | ||
$migrationSettings['--realpath'] = $this->realPath ?? false; | ||
} | ||
|
||
if (property_exists($this, 'migrationPaths')) { | ||
$migrationSettings['--path'] = $this->migrationPaths; | ||
} | ||
|
||
return $migrationSettings; | ||
} | ||
|
||
/** | ||
* Determine if custom analyzers should be dropped when refreshing the database. | ||
* | ||
* @return bool | ||
*/ | ||
protected function shouldDropAnalyzers() | ||
{ | ||
return property_exists($this, 'dropAnalyzers') ? $this->dropAnalyzers : false; | ||
} | ||
|
||
/** | ||
* Determine if graphs should be dropped when refreshing the database. | ||
* | ||
* @return bool | ||
*/ | ||
protected function shouldDropGraphs() | ||
{ | ||
return property_exists($this, 'dropGraphs') ? $this->dropGraphs : false; | ||
} | ||
|
||
|
||
/** | ||
* Determine if all analyzers, graphs and views should be dropped when refreshing the database. | ||
* | ||
* @return bool | ||
*/ | ||
protected function shouldDropAll() | ||
{ | ||
return property_exists($this, 'dropAll') ? $this->dropAll : false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters