@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | // test with null $emailOrAddressOrList |
| 64 | 64 | $target->setFrom(null); |
| 65 | - $this->assertEquals(0,$target->getFrom()->count()); |
|
| 65 | + $this->assertEquals(0, $target->getFrom()->count()); |
|
| 66 | 66 | |
| 67 | 67 | // updateAddressList should handle an array with email => display name format |
| 68 | 68 | $target = new Message(); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | public function testSetSubjectDoesNotTranslate() |
| 95 | 95 | { |
| 96 | 96 | $translator = $this->getMockBuilder(Translator::class)->disableOriginalConstructor() |
| 97 | - ->setMethods(['translate'])->getMock(); |
|
| 97 | + ->setMethods(['translate'])->getMock(); |
|
| 98 | 98 | $translator->expects($this->never())->method('translate'); |
| 99 | 99 | |
| 100 | 100 | $this->target->setTranslator($translator); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | private $target = TranslatorAwareMessage::class; |
| 38 | 38 | |
| 39 | - private $inheritance = [ Message::class, TranslatorAwareInterface::class ]; |
|
| 39 | + private $inheritance = [Message::class, TranslatorAwareInterface::class]; |
|
| 40 | 40 | |
| 41 | 41 | public function propertiesProvider() |
| 42 | 42 | { |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | public function testOverrideRecipient() |
| 108 | 108 | { |
| 109 | 109 | $overrideEmail = 'overidden@email'; |
| 110 | - $ccEmail="cc@email"; |
|
| 111 | - $bccEmail="bcc@email"; |
|
| 112 | - $toEmail="to@email"; |
|
| 110 | + $ccEmail = "cc@email"; |
|
| 111 | + $bccEmail = "bcc@email"; |
|
| 112 | + $toEmail = "to@email"; |
|
| 113 | 113 | |
| 114 | 114 | $recipients = new AddressList(); |
| 115 | 115 | $recipients->add($overrideEmail); |
@@ -126,13 +126,13 @@ discard block |
||
| 126 | 126 | $this->target->send($mail); |
| 127 | 127 | |
| 128 | 128 | $headers = $mail->getHeaders(); |
| 129 | - $expectedTo = 'To: ' . $overrideEmail; |
|
| 129 | + $expectedTo = 'To: '.$overrideEmail; |
|
| 130 | 130 | $this->assertFalse($headers->has('cc')); |
| 131 | 131 | $this->assertFalse($headers->has('bcc')); |
| 132 | 132 | $this->assertTrue($headers->has('X-Original-Recipients')); |
| 133 | 133 | |
| 134 | 134 | $this->assertEquals($expectedTo, $headers->get('to')->toString()); |
| 135 | - $this->assertEquals('X-Original-Recipients: To: ' . $toEmail . '; Cc: ' . $ccEmail . '; Bcc: ' . $bccEmail, $headers->get('X-Original-Recipients')->toString()); |
|
| 135 | + $this->assertEquals('X-Original-Recipients: To: '.$toEmail.'; Cc: '.$ccEmail.'; Bcc: '.$bccEmail, $headers->get('X-Original-Recipients')->toString()); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | public function testSetsXMailerHeader() |
@@ -82,19 +82,19 @@ |
||
| 82 | 82 | )); |
| 83 | 83 | |
| 84 | 84 | $translator = $this->getMockBuilder('\Zend\I18n\Translator\Translator') |
| 85 | - ->disableOriginalConstructor() |
|
| 86 | - ->getMock(); |
|
| 85 | + ->disableOriginalConstructor() |
|
| 86 | + ->getMock(); |
|
| 87 | 87 | |
| 88 | 88 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
| 89 | - ->disableOriginalConstructor() |
|
| 90 | - ->getMock(); |
|
| 89 | + ->disableOriginalConstructor() |
|
| 90 | + ->getMock(); |
|
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | $services |
| 94 | - ->expects($this->once()) |
|
| 95 | - ->method('get') |
|
| 96 | - ->with('translator') |
|
| 97 | - ->willReturn($translator) |
|
| 94 | + ->expects($this->once()) |
|
| 95 | + ->method('get') |
|
| 96 | + ->with('translator') |
|
| 97 | + ->willReturn($translator) |
|
| 98 | 98 | ; |
| 99 | 99 | |
| 100 | 100 | $target = new MailService($services,$config->toArray()); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'stringtemplate' => '\Core\Mail\StringTemplateMessage', |
| 65 | 65 | ); |
| 66 | 66 | $factories = array( |
| 67 | - 'htmltemplate' => [HTMLTemplateMessage::class,'factory'] |
|
| 67 | + 'htmltemplate' => [HTMLTemplateMessage::class, 'factory'] |
|
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | $this->assertAttributeEquals(false, 'shareByDefault', $target, 'shareByDefault is not set to FALSE'); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ->willReturn($translator) |
| 98 | 98 | ; |
| 99 | 99 | |
| 100 | - $target = new MailService($services,$config->toArray()); |
|
| 100 | + $target = new MailService($services, $config->toArray()); |
|
| 101 | 101 | //$target->setServiceLocator($services); |
| 102 | 102 | |
| 103 | 103 | $mail = $target->get('testTranslatorMessage'); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $options = $this->createMock(FileOptions::class); |
| 34 | 34 | $options->expects($this->once()) |
| 35 | 35 | ->method('getCallback') |
| 36 | - ->willReturn([$this,'getFileName']) |
|
| 36 | + ->willReturn([$this, 'getFileName']) |
|
| 37 | 37 | ; |
| 38 | 38 | $options->expects($this->exactly(2)) |
| 39 | 39 | ->method('getPath') |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | public function testSend() |
| 55 | 55 | { |
| 56 | 56 | $testPath = sys_get_temp_dir().'/yawik/mails'; |
| 57 | - if(!is_dir($testPath)){ |
|
| 58 | - mkdir($testPath,0777,true); |
|
| 57 | + if (!is_dir($testPath)) { |
|
| 58 | + mkdir($testPath, 0777, true); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $message = $this->createMock(Message::class); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | $container->expects($this->any()) |
| 46 | 46 | ->method('get') |
| 47 | 47 | ->willReturnMap([ |
| 48 | - ['Config',[]], |
|
| 49 | - ['Auth/Options',$authOptions], |
|
| 50 | - ['Core/MailServiceOptions',$mailOptions] |
|
| 48 | + ['Config', []], |
|
| 49 | + ['Auth/Options', $authOptions], |
|
| 50 | + ['Core/MailServiceOptions', $mailOptions] |
|
| 51 | 51 | ] |
| 52 | 52 | ); |
| 53 | 53 | |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | /* @var \Core\Mail\MailService $service */ |
| 60 | 60 | /* @var \Zend\ServiceManager\Factory\FactoryInterface $target */ |
| 61 | - $service = $target($container,'some-name'); |
|
| 61 | + $service = $target($container, 'some-name'); |
|
| 62 | 62 | $this->assertInstanceOf( |
| 63 | 63 | MailService::class, |
| 64 | 64 | $service |
| 65 | 65 | ); |
| 66 | - $this->assertSame($transport,$service->getTransport()); |
|
| 66 | + $this->assertSame($transport, $service->getTransport()); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public function testGetTransport() |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | $factory = new MailServiceFactory(); |
| 73 | 73 | |
| 74 | 74 | $options->setTransportClass('smtp'); |
| 75 | - $this->assertInstanceOf(Smtp::class,$factory->getTransport($options)); |
|
| 75 | + $this->assertInstanceOf(Smtp::class, $factory->getTransport($options)); |
|
| 76 | 76 | |
| 77 | 77 | $options->setTransportClass('file'); |
| 78 | - $this->assertInstanceOf(FileTransport::class,$factory->getTransport($options)); |
|
| 78 | + $this->assertInstanceOf(FileTransport::class, $factory->getTransport($options)); |
|
| 79 | 79 | |
| 80 | 80 | $options->setTransportClass('sendmail'); |
| 81 | - $this->assertInstanceOf(Sendmail::class,$factory->getTransport($options)); |
|
| 81 | + $this->assertInstanceOf(Sendmail::class, $factory->getTransport($options)); |
|
| 82 | 82 | |
| 83 | 83 | $this->expectException(ServiceNotCreatedException::class); |
| 84 | 84 | $this->expectExceptionMessageRegExp('/\"foo\" is not a valid/'); |
| 85 | 85 | |
| 86 | 86 | $options->setTransportClass('foo'); |
| 87 | - $this->assertInstanceOf(Sendmail::class,$factory->getTransport($options)); |
|
| 87 | + $this->assertInstanceOf(Sendmail::class, $factory->getTransport($options)); |
|
| 88 | 88 | |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | ->willReturn(true); |
| 212 | 212 | $view |
| 213 | 213 | ->method('render') |
| 214 | - ->with($this->callback(function (ViewModel $subject) { |
|
| 214 | + ->with($this->callback(function(ViewModel $subject) { |
|
| 215 | 215 | return $subject->getTemplate() === 'template.en'; |
| 216 | 216 | })); |
| 217 | 217 | $target->getBodyText(); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | ->willReturn(false); |
| 231 | 231 | $view |
| 232 | 232 | ->method('render') |
| 233 | - ->with($this->callback(function (ViewModel $subject) { |
|
| 233 | + ->with($this->callback(function(ViewModel $subject) { |
|
| 234 | 234 | return $subject->getTemplate() === 'template'; |
| 235 | 235 | })); |
| 236 | 236 | $target->getBodyText(); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | use TestInheritanceTrait, TestSetterGetterTrait; |
| 28 | 28 | |
| 29 | - protected $target = [ '\Core\Entity\Exception\ImmutableEntityException', [ 'entityClassName' ] ]; |
|
| 29 | + protected $target = ['\Core\Entity\Exception\ImmutableEntityException', ['entityClassName']]; |
|
| 30 | 30 | |
| 31 | 31 | protected $inheritance = [ |
| 32 | 32 | '\RuntimeException', |
@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | public function propertiesProvider() |
| 38 | 38 | { |
| 39 | 39 | return [ |
| 40 | - [ 'message', [ |
|
| 40 | + ['message', [ |
|
| 41 | 41 | 'value' => 'entityClassName is an immutable entity.', |
| 42 | 42 | 'ignore_setter' => true, |
| 43 | 43 | ]], |
| 44 | - [ 'message', [ |
|
| 44 | + ['message', [ |
|
| 45 | 45 | 'value' => 'stdClass is an immutable entity.', |
| 46 | 46 | 'ignore_setter' => true, |
| 47 | - 'target' => ['\Core\Entity\Exception\ImmutableEntityException', [ new \stdClass() ] ] |
|
| 47 | + 'target' => ['\Core\Entity\Exception\ImmutableEntityException', [new \stdClass()]] |
|
| 48 | 48 | ]] |
| 49 | 49 | ]; |
| 50 | 50 | } |
@@ -36,19 +36,19 @@ |
||
| 36 | 36 | public function propertiesProvider() |
| 37 | 37 | { |
| 38 | 38 | return [ |
| 39 | - [ 'permissions', [ |
|
| 39 | + ['permissions', [ |
|
| 40 | 40 | 'default' => new Permissions('Test/TestEntity'), |
| 41 | 41 | 'value' => new Permissions('Test') |
| 42 | 42 | |
| 43 | 43 | ]], |
| 44 | - [ 'permissions', [ |
|
| 44 | + ['permissions', [ |
|
| 45 | 45 | 'default' => new Permissions(PermissionsAwareEntityWithPermissionsType::TYPE), |
| 46 | 46 | 'value' => false, |
| 47 | 47 | 'ignore_setter' => true, |
| 48 | 48 | 'ignore_getter' => true, |
| 49 | 49 | |
| 50 | 50 | ]], |
| 51 | - [ 'permissions', [ |
|
| 51 | + ['permissions', [ |
|
| 52 | 52 | 'default' => new Permissions(PermissionsAwareEntityWithSetupPermissions::TYPE), |
| 53 | 53 | 'value' => false, |
| 54 | 54 | 'ignore_setter' => true, 'ignore_getter' => true, |