-
Notifications
You must be signed in to change notification settings - Fork 4
Create unit tests for app fixtures.php #136
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
Create unit tests for app fixtures.php #136
Conversation
Add protected method testing for getFilePaths
Php unit was blowing up if files were called by require_once, changed it to require
Add entityManager Change test name as KernelTestCase Update static assert calling for $this-> to self::
@pfwd needs your early review for some db tests, I left a comment related load function test would you mind having a look at it please :) |
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
Protected to Public
Methods are now publicly accessible for tests
Set object manager on load
Mock the ObjectManager, persist and flush method
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.
Great work. Thanks for doing this. Could you make some changes to the tests and imports please.
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
api/tests/unit/config/fixtures/data_fixtures/AppFixturesTest.php
Outdated
Show resolved
Hide resolved
Use ObjectManager::class instead of a string
176e806
to
8411725
Compare
Thanks for reviews, I believe it improves my coding skills 👍 |
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.
Nicely done 👍
To test load function inside AppFixtures class
Should we run such command for creating test database and if yes where should we define it :) ?
docker-compose exec api bin/console --env=test doctrine:database:create