-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.x] Remove FixturesTrait #26
Conversation
3765580
to
c0c3fe3
Compare
#25 is done. any other show-stoppers? |
I have to fix the tests.
|
PHP 7.1 living out its days with security fixes only now. EOL is on Dec 2019. Is it really worth to support? |
It may fix the performance issue reported in #12 |
c0c3fe3
to
78a0688
Compare
Upgrade guide is missing. |
78a0688
to
6d5f586
Compare
2803d51
to
14e978e
Compare
Using Maybe we could keep the |
fb0dcb9
to
dab392c
Compare
dab392c
to
6b32011
Compare
87d77d9
to
97a4444
Compare
97a4444
to
f7e3e54
Compare
|
||
$executor->getReferenceRepository()->save($this->getBackupFilePath()); | ||
self::$metadata = $em->getMetadataFactory()->getLoadedMetadata(); | ||
|
||
exec("mysqldump --host {$dbHost} {$port} {$dbPass} --user {$dbUser} --no-create-info --skip-triggers --no-create-db --no-tablespaces --compact {$dbName} > {$this->getBackupFilePath()}"); | ||
exec("{$dbPass} mysqldump --host {$dbHost} {$port} --user {$dbUser} --no-create-info --skip-triggers --no-create-db --no-tablespaces --compact {$dbName} > {$this->getBackupFilePath()}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the password is passed as an environment variable to avoid a warning from mysqldump
.
@@ -77,12 +77,10 @@ public function loadFixtures(array $classNames = [], bool $append = false): Abst | |||
if ($backupService) { | |||
$event = new ReferenceSaveEvent($this->om, $executor, $backupService->getBackupFilePath()); | |||
$this->eventDispatcher->dispatch($event, LiipTestFixturesEvents::PRE_REFERENCE_SAVE); | |||
$this->testCase->preReferenceSave($this->om, $executor, $backupService->getBackupFilePath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this already documented in the upgrading guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #105
$eventDispatcher->addListener( | ||
$eventName, | ||
[$mock, $methodName] | ||
); | ||
|
||
// By loading fixtures, the events will be called (or not) | ||
$fixtures = $this->loadFixtures([]); | ||
if ($withCache) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just FYI .. in such an if/else situation with single line assignments to the same variable, I personally prefer a ternary for readability. but I have no intention of enforcing such a personal preference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just read over the PR, I think overall this looks awesome. I will also ask for feedback via twitter
d1db9ed
to
328a74a
Compare
328a74a
to
bea8371
Compare
Thanks for the review. I updated the documentation. I will add events to the upgrade guide later. And update the services to use classes names too, right now it breaks the tests and I don't understand why. |
See #18
TODO: