-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
2,512 additions
and
158 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
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
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
fixtures/applications/Symfony/config/packages_symfony6+/test/framework.yaml
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,4 @@ | ||
framework: | ||
test: true | ||
session: | ||
storage_factory_id: session.storage.factory.mock_file |
12 changes: 5 additions & 7 deletions
12
fixtures/applications/Symfony/config/routes/annotations.yaml
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
controllers: | ||
resource: '../../src/Controller/' | ||
type: annotation | ||
|
||
kernel: | ||
resource: ../../src/Kernel.php | ||
type: annotation | ||
send_basic_email: | ||
path: /send-basic-email | ||
controller: Kocal\SymfonyMailerTesting\Fixtures\Applications\Symfony\App\Controller\EmailController::sendBasicEmail | ||
methods: [POST] | ||
format: json |
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 |
---|---|---|
|
@@ -10,24 +10,20 @@ | |
use Symfony\Component\Mailer\MailerInterface; | ||
use Symfony\Component\Mime\Address; | ||
use Symfony\Component\Mime\Email; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
class EmailController extends AbstractController | ||
{ | ||
/** | ||
* @Route("/send-basic-email", methods={"POST"}, defaults={"format": "json"}) | ||
*/ | ||
public function sendBasicEmail(Request $request, MailerInterface $mailer): Response | ||
{ | ||
$email = (new Email()) | ||
->from(Address::fromString($request->request->get('from', '[email protected]'))) | ||
->to(Address::fromString($request->request->get('to', '[email protected]'))) | ||
->from(Address::create($request->request->get('from', '[email protected]'))) | ||
->to(Address::create($request->request->get('to', '[email protected]'))) | ||
->subject($request->request->get('subject', 'Email sent from a Symfony application!')) | ||
->text($request->request->get('text', 'Hello world!')) | ||
->html($request->request->get('html', '<b>Hello world!</b>')) | ||
; | ||
|
||
foreach ($request->request->get('attachments', []) as $attachment) { | ||
foreach ($request->request->all('attachments') as $attachment) { | ||
$email->attach($attachment['body'], $attachment['name'] ?? null, $attachment['contentType'] ?? null); | ||
} | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Method Kocal\\\\SymfonyMailerTesting\\\\Tests\\\\Bridge\\\\Behat\\\\EmailContext\\:\\:iSendAnEmail\\(\\) has parameter \\$table with no value type specified in iterable type Behat\\\\Gherkin\\\\Node\\\\TableNode\\.$#" | ||
count: 1 | ||
path: tests/Bridge/Behat/bootstrap/EmailContext.php | ||
|
||
- | ||
message: "#^Access to an undefined static property static\\(Kocal\\\\SymfonyMailerTesting\\\\Tests\\\\Bridge\\\\Symfony\\\\EventListener\\\\MailerLoggerListenerTest\\)\\:\\:\\$container\\.$#" | ||
count: 2 | ||
path: tests/Bridge/Symfony/EventListener/MailerLoggerListenerTest.php | ||
|
||
- | ||
message: "#^Call to function method_exists\\(\\) with \\$this\\(Kocal\\\\SymfonyMailerTesting\\\\Tests\\\\Bridge\\\\Symfony\\\\EventListener\\\\MailerLoggerListenerTest\\) and 'getContainer' will always evaluate to true\\.$#" | ||
count: 2 | ||
path: tests/Bridge/Symfony/EventListener/MailerLoggerListenerTest.php | ||
|
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 |
---|---|---|
@@ -1,31 +1,28 @@ | ||
includes: | ||
- vendor/phpstan/phpstan-strict-rules/rules.neon | ||
- vendor/phpstan/phpstan-phpunit/extension.neon | ||
- vendor/phpstan/phpstan-phpunit/rules.neon | ||
- vendor/phpstan/phpstan-webmozart-assert/extension.neon | ||
- vendor/phpstan/phpstan-symfony/extension.neon | ||
- vendor/phpstan/phpstan-symfony/rules.neon | ||
- ./phpstan-baseline.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-phpunit/extension.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-phpunit/rules.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-webmozart-assert/extension.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-symfony/extension.neon | ||
- tools/phpstan/vendor/phpstan/phpstan-symfony/rules.neon | ||
|
||
parameters: | ||
level: max | ||
|
||
paths: | ||
- src | ||
- tests | ||
# - spec wait for PHPStan 0.12 support (https://github.com/proget-hq/phpstan-phpspec) | ||
|
||
excludes_analyse: | ||
- fixtures/applications/Symfony | ||
- spec # wait for PHPStan 0.12 support (https://github.com/proget-hq/phpstan-phpspec) | ||
|
||
symfony: | ||
container_xml_path: 'fixtures/applications/Symfony/var/cache/test/Kocal_SymfonyMailerTesting_Fixtures_Applications_Symfony_App_KernelTestDebugContainer.xml' | ||
|
||
inferPrivatePropertyTypeFromConstructor: true | ||
|
||
reportUnmatchedIgnoredErrors: false | ||
ignoreErrors: | ||
# Should be fixed by Symfony | ||
- '#Property Kocal\\SymfonyMailerTesting\\Tests\\Bridge\\Symfony\\(.*?)::\$class has no typehint specified.#' | ||
|
||
# Should be fixed by behat | ||
- '#with no value type specified in iterable type Behat\\Gherkin\\Node\\TableNode.$#' |
39 changes: 0 additions & 39 deletions
39
spec/Kocal/SymfonyMailerTesting/Bridge/Symfony/EventListener/MailerLoggerListenerSpec.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.