-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8131 from magento-l3/PR-2023-02-07
Pr 2023 02 07
- Loading branch information
Showing
53 changed files
with
1,274 additions
and
228 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
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
26 changes: 0 additions & 26 deletions
26
app/code/Magento/Customer/ViewModel/CreateAccountButton.php
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
app/code/Magento/Customer/ViewModel/ForgotPasswordButton.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Email\Test\Fixture; | ||
|
||
use Magento\Framework\App\Filesystem\DirectoryList; | ||
use Magento\Framework\DataObject; | ||
use Magento\Framework\DataObjectFactory; | ||
use Magento\Framework\Filesystem; | ||
use Magento\Framework\Serialize\Serializer\Json; | ||
use Magento\TestFramework\Fixture\Data\ProcessorInterface; | ||
use Magento\TestFramework\Fixture\RevertibleDataFixtureInterface; | ||
|
||
class FileTransport implements RevertibleDataFixtureInterface | ||
{ | ||
private const DEFAULT_DATA = [ | ||
'directory' => DirectoryList::TMP, | ||
'path' => 'mail/%uniqid%', | ||
]; | ||
|
||
private const CONFIG_FILE = 'mail-transport-config.json'; | ||
|
||
/** | ||
* @var Filesystem | ||
*/ | ||
private Filesystem $filesystem; | ||
|
||
/** | ||
* @var Json | ||
*/ | ||
private Json $json; | ||
|
||
/** | ||
* @var ProcessorInterface | ||
*/ | ||
private ProcessorInterface $dataProcessor; | ||
|
||
/** | ||
* @var DataObjectFactory | ||
*/ | ||
private DataObjectFactory $dataObjectFactory; | ||
|
||
/** | ||
* @param Filesystem $filesystem | ||
* @param Json $json | ||
* @param ProcessorInterface $dataProcessor | ||
* @param DataObjectFactory $dataObjectFactory | ||
*/ | ||
public function __construct( | ||
Filesystem $filesystem, | ||
Json $json, | ||
ProcessorInterface $dataProcessor, | ||
DataObjectFactory $dataObjectFactory | ||
) { | ||
$this->filesystem = $filesystem; | ||
$this->json = $json; | ||
$this->dataProcessor = $dataProcessor; | ||
$this->dataObjectFactory = $dataObjectFactory; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* @param array $data Parameters | ||
* <pre> | ||
* $data = [ | ||
* 'directory' => (string) Filesystem directory code. Optional. Default: tmp dir | ||
* 'path' => (string) Relative path to "directory" where to save mails. Optional. Default: autogenerated | ||
* ] | ||
* </pre> | ||
*/ | ||
public function apply(array $data = []): ?DataObject | ||
{ | ||
$data = $this->dataProcessor->process($this, array_merge(self::DEFAULT_DATA, $data)); | ||
$directory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); | ||
$directory->writeFile(self::CONFIG_FILE, $this->json->serialize($data)); | ||
|
||
return $this->dataObjectFactory->create(['data' => $data]); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function revert(DataObject $data): void | ||
{ | ||
$directory = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); | ||
$config = $this->json->unserialize($directory->readFile(self::CONFIG_FILE)); | ||
$directory->delete(self::CONFIG_FILE); | ||
$directory = $this->filesystem->getDirectoryWrite($config['directory']); | ||
$directory->delete($config['path']); | ||
} | ||
} |
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
Oops, something went wrong.