Conversation
loic425
commented
Jan 15, 2025
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Related tickets | |
| License | MIT |
59212f9 to
19bf967
Compare
7500a98 to
0c6d68d
Compare
0c6d68d to
984eb9a
Compare
tests/ApiTestCase.php
Outdated
| protected Matcher $matcher; | ||
|
|
||
| #[Before] | ||
| protected function _createClient(): void |
There was a problem hiding this comment.
Does _ function prefix passes CS checks?
There was a problem hiding this comment.
Yes, it's a common way in this kind of trait.
https://github.com/zenstruck/foundry/blob/2.x/src/Test/ResetDatabase.php#L29
We are in the test application. For now I do not plan to make a small lib with that kind of traits.
I'd like to remove my PurgeDatabaseTrait to be honest. I have some issues with ResetDatabase (from Foundry package) sometimes, but I plan to remove this PurgeDatabaseTrait at some point.
tests/Application/src/Tests/Controller/SubscriptionJsonApiTest.php
Outdated
Show resolved
Hide resolved
9056331 to
818060b
Compare
818060b to
bc900f2
Compare
| } | ||
|
|
||
| #[Before] | ||
| protected static function _createMatcher(): Matcher |
There was a problem hiding this comment.
If this change possible, the same as with createClient/setupClient change.
| protected static function _createMatcher(): Matcher | |
| protected static function createMatcher(): Matcher | |
| protected static function setupMatcher(): Matcher |
| $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); | ||
|
|
||
| $this->assertResponseIsSuccessful(); | ||
| $this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT); |
There was a problem hiding this comment.
This test doesn't appear to be checking if PUT action actually changed comic book data.
| $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); | ||
|
|
||
| $this->assertResponseIsSuccessful(); | ||
| $this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT); |
There was a problem hiding this comment.
I think it's still actual.
$deletedComicBook = $this->getContainer()->get('app.repository.comic_book')->find($comicBookId);
$this->assertNull($deletedComicBook);| $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); | ||
|
|
||
| $this->assertResponseIsSuccessful(); | ||
| $this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT); |
There was a problem hiding this comment.
This test doesn't appear to be checking if PUT action actually happened.
| { | ||
| return $this->matcherFactory->createMatcher(new VoidBacktrace()); | ||
| $this->assertResponseIsSuccessful(); | ||
| $this->assertResponseStatusCodeSame(Response::HTTP_NO_CONTENT); |
There was a problem hiding this comment.
This test doesn't appear to be checking if subscription was actually removed.