/** * Test that getMaskManager returns Magoo or compatible */ public function testGetMaskManager() { // Arrange $magoo = new Magoo(); $magoo->pushEmailMask()->pushCreditCardMask(); $magooArray = new MagooArray($magoo); // Act // Assert $this->assertSame($magoo, $magooArray->getMaskManager()); }
<?php /** * This file is part of Pachico/Magoo. (https://github.com/pachico/magoo) * * @link https://github.com/pachico/magoo for the canonical source repository * @copyright Copyright (c) 2015-2016 Mariano F.co BenÃtez Mulet. (https://github.com/pachico/) * @license https://raw.githubusercontent.com/pachico/magoo/master/LICENSE.md MIT */ require __DIR__ . '/../vendor/autoload.php'; use Pachico\Magoo\Magoo; $magoo = new Magoo(); $magoo->pushEmailMask('$', '*'); $mySensitiveString = 'My email is pachicodev@gmail.com but I need privacy.'; echo $magoo->getMasked($mySensitiveString . PHP_EOL); // My email is $$$$$$$$$$@********* but I need privacy.
/** * Testing Magoo */ public function testGetMaskManager() { // Arrange $magoo = new Magoo(); $magoo->pushEmailMask(); $logger = new Logger('app'); $handler = new TestHandler(); $logger->pushHandler($handler); $magooLogger = new MagooLogger($logger, $magoo); // Act // Assert $this->assertSame($magoo, $magooLogger->getMaskManager()); }