-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-59809: Scrub sensitive data during app:dump
- Loading branch information
1 parent
0f97776
commit f33dd60
Showing
9 changed files
with
107 additions
and
14 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
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
76 changes: 76 additions & 0 deletions
76
app/code/Magento/Config/Test/Unit/Model/Placeholder/PlaceholderFactoryTest.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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Config\Test\Unit\Model\Placeholder; | ||
|
||
use Magento\Config\Model\Placeholder\Environment; | ||
use Magento\Config\Model\Placeholder\PlaceholderFactory; | ||
use Magento\Framework\ObjectManagerInterface; | ||
|
||
class PlaceholderFactoryTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var PlaceholderFactory | ||
*/ | ||
private $model; | ||
|
||
/** | ||
* @var ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $objectManagerMock; | ||
|
||
/** | ||
* @var Environment|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $environmentMock; | ||
|
||
protected function setUp() | ||
{ | ||
$this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class) | ||
->getMockForAbstractClass(); | ||
$this->environmentMock = $this->getMockBuilder(Environment::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
|
||
$this->model = new PlaceholderFactory( | ||
$this->objectManagerMock, | ||
[ | ||
PlaceholderFactory::TYPE_ENVIRONMENT => Environment::class, | ||
'wrongClass' => \stdClass::class, | ||
] | ||
); | ||
} | ||
|
||
public function testCreate() | ||
{ | ||
$this->objectManagerMock->expects($this->once()) | ||
->method('create') | ||
->with(Environment::class) | ||
->willReturn($this->environmentMock); | ||
|
||
$this->assertInstanceOf( | ||
Environment::class, | ||
$this->model->create(PlaceholderFactory::TYPE_ENVIRONMENT) | ||
); | ||
} | ||
|
||
/** | ||
* @expectedException \Magento\Framework\Exception\LocalizedException | ||
* @expectedExceptionMessage There is no defined type dummyClass | ||
*/ | ||
public function testCreateNonExisted() | ||
{ | ||
$this->model->create('dummyClass'); | ||
} | ||
|
||
/** | ||
* @expectedException \Magento\Framework\Exception\LocalizedException | ||
* @expectedExceptionMessage Object is not instance of Magento\Config\Model\Placeholder\PlaceholderInterface | ||
*/ | ||
public function testCreateWrongImplementation() | ||
{ | ||
$this->model->create('wrongClass'); | ||
} | ||
} |
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