@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | public function testProxiesMethodToAuthenticationService() |
45 | 45 | { |
46 | 46 | $auth = $this->getMockBuilder('\Auth\AuthenticationService') |
47 | - ->disableOriginalConstructor() |
|
48 | - ->getMock(); |
|
47 | + ->disableOriginalConstructor() |
|
48 | + ->getMock(); |
|
49 | 49 | |
50 | 50 | $auth->expects($this->once()) |
51 | - ->method('getUser') |
|
52 | - ->willReturn(true); |
|
51 | + ->method('getUser') |
|
52 | + ->willReturn(true); |
|
53 | 53 | |
54 | 54 | $target = new AuthHelper(); |
55 | 55 | $target->setService($auth); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | public function testThrowsExceptionIfTryingToProxyToUnknownMethod() |
66 | 66 | { |
67 | 67 | $auth = $this->getMockBuilder('\Auth\AuthenticationService') |
68 | - ->disableOriginalConstructor() |
|
69 | - ->getMock(); |
|
68 | + ->disableOriginalConstructor() |
|
69 | + ->getMock(); |
|
70 | 70 | |
71 | 71 | $target = new AuthHelper(); |
72 | 72 | $target->setService($auth); |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | public function testAuthenticationServiceCanBeSetAndRetrievedViaSetterAndGetterMethods() |
78 | 78 | { |
79 | 79 | $auth = $this->getMockBuilder('\Auth\AuthenticationService') |
80 | - ->disableOriginalConstructor() |
|
81 | - ->getMock(); |
|
80 | + ->disableOriginalConstructor() |
|
81 | + ->getMock(); |
|
82 | 82 | |
83 | 83 | $target = new AuthHelper(); |
84 | 84 | |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | $user->setLogin($login); |
109 | 109 | |
110 | 110 | $auth = $this->getMockBuilder('Auth\AuthenticationService') |
111 | - ->disableOriginalConstructor() |
|
112 | - ->getMock(); |
|
111 | + ->disableOriginalConstructor() |
|
112 | + ->getMock(); |
|
113 | 113 | |
114 | 114 | $auth->expects($this->exactly(2)) |
115 | - ->method('getUser') |
|
116 | - ->willReturn($user); |
|
115 | + ->method('getUser') |
|
116 | + ->willReturn($user); |
|
117 | 117 | |
118 | 118 | $target = new AuthHelper(); |
119 | 119 | $target->setService($auth); |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | public function testIsAbleToCheckIfAUserIsCurrentlyLoggedIn() |
126 | 126 | { |
127 | 127 | $auth = $this->getMockBuilder('Auth\AuthenticationService') |
128 | - ->disableOriginalConstructor() |
|
129 | - ->getMock(); |
|
128 | + ->disableOriginalConstructor() |
|
129 | + ->getMock(); |
|
130 | 130 | |
131 | 131 | $auth->expects($this->exactly(2)) |
132 | - ->method('hasIdentity') |
|
133 | - ->will($this->onConsecutiveCalls(true, false)); |
|
132 | + ->method('hasIdentity') |
|
133 | + ->will($this->onConsecutiveCalls(true, false)); |
|
134 | 134 | |
135 | 135 | $target = new AuthHelper(); |
136 | 136 | $target->setService($auth); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | |
86 | 86 | $filter->setUri('http://aaa.bbb.cc/ddd/'); |
87 | 87 | $f = $filter->filter($test['original']); |
88 | - preg_match_all ( '/(?:href|src)\s*=\s*"([^"]*)"/', $f, $matches); |
|
88 | + preg_match_all('/(?:href|src)\s*=\s*"([^"]*)"/', $f, $matches); |
|
89 | 89 | foreach ($matches[1] as $uri) { |
90 | 90 | $this->assertRegExp("/^https?:\/\//", $uri); |
91 | 91 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | public function testFromHeaderMethod() |
77 | 77 | { |
78 | 78 | $headers = "X-Test-Header-1: Header1Value\r\n" |
79 | - . "X-Test-Header-2: Header2Value\r\n"; |
|
79 | + . "X-Test-Header-2: Header2Value\r\n"; |
|
80 | 80 | |
81 | 81 | $r = new Request(); |
82 | 82 | $r->setHeaders(\Zend\Http\Headers::fromString($headers)); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | class ParamsTest extends \PHPUnit_Framework_TestCase |
17 | 17 | { |
18 | 18 | |
19 | - public function getHelper(MvcEvent $e=null) |
|
19 | + public function getHelper(MvcEvent $e = null) |
|
20 | 20 | { |
21 | 21 | if (null == $e) { |
22 | 22 | $e = new MvcEvent(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function testFromFilesMethod() |
53 | 53 | { |
54 | - $_FILES=array( |
|
54 | + $_FILES = array( |
|
55 | 55 | 'testFile1' => array( |
56 | 56 | 'name' => 'testfile1.txt', |
57 | 57 | 'type' => 'text/plain', |
@@ -28,7 +28,7 @@ |
||
28 | 28 | public function testExtendsZfAbstractHelper() |
29 | 29 | { |
30 | 30 | $options = new ModuleOptions; |
31 | - $target = new SocialButtons($options,[]); |
|
31 | + $target = new SocialButtons($options, []); |
|
32 | 32 | $this->assertInstanceOf('\Zend\View\Helper\AbstractHelper', $target); |
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | public function testDirectInvokationProxiesToCorrectMethod() |
45 | 45 | { |
46 | 46 | $target = $this->getMockBuilder('\Install\Controller\Plugin\Prerequisites') |
47 | - ->setMethods(array('check')) |
|
48 | - ->getMock(); |
|
47 | + ->setMethods(array('check')) |
|
48 | + ->getMock(); |
|
49 | 49 | |
50 | 50 | /* @var $target \PHPUnit_Framework_MockObject_MockObject|Prerequisites */ |
51 | 51 | $target->expects($this->once())->method('check')->willReturn(true); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | public function testCheckCallsCheckDirectory() |
57 | 57 | { |
58 | 58 | $target = $this->getMockBuilder('\Install\Controller\Plugin\Prerequisites') |
59 | - ->setMethods(array('checkDirectory')) |
|
60 | - ->getMock(); |
|
59 | + ->setMethods(array('checkDirectory')) |
|
60 | + ->getMock(); |
|
61 | 61 | |
62 | 62 | $target->expects($this->exactly(3))->method('checkDirectory')->willReturn(array('valid' => true)); |
63 | 63 | |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | $dirStr = implode(DIRECTORY_SEPARATOR, $dirParts); |
109 | 109 | |
110 | 110 | $target = $this->getMockBuilder('\Install\Controller\Plugin\Prerequisites') |
111 | - ->setMethods(array('validateDirectory')) |
|
112 | - ->getMock(); |
|
111 | + ->setMethods(array('validateDirectory')) |
|
112 | + ->getMock(); |
|
113 | 113 | |
114 | 114 | $expectedValidateArg = $expected; |
115 | 115 | unset($expectedValidateArg['valid']); |
@@ -39,7 +39,9 @@ |
||
39 | 39 | |
40 | 40 | $this->target = new YawikConfigCreator($extractor); |
41 | 41 | |
42 | - if (0 === strpos($this->getName(false), 'testExtends')) return; |
|
42 | + if (0 === strpos($this->getName(false), 'testExtends')) { |
|
43 | + return; |
|
44 | + } |
|
43 | 45 | |
44 | 46 | chdir(__DIR__); |
45 | 47 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $this->assertContains("'default_db' => 'TestDbName'", $result); |
56 | 56 | $this->assertContains("'connectionString' => 'mongodb://server/TestDbName'", $result); |
57 | 57 | $this->assertContains("'core_options'", $result); |
58 | - $this->assertContains("'system_message_email' => 'test@email'", $result ); |
|
58 | + $this->assertContains("'system_message_email' => 'test@email'", $result); |
|
59 | 59 | |
60 | 60 | $result = $this->target->process('mongodb://server', 'test@email'); |
61 | 61 | |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | |
65 | 65 | public function testWritingConfigFileWorks() |
66 | 66 | { |
67 | - $dir = sys_get_temp_dir() . '/YawikConfigCreator-' . uniqid(); |
|
67 | + $dir = sys_get_temp_dir().'/YawikConfigCreator-'.uniqid(); |
|
68 | 68 | |
69 | 69 | mkdir($dir); |
70 | - mkdir($dir . '/config'); |
|
71 | - mkdir($dir . '/config/autoload'); |
|
70 | + mkdir($dir.'/config'); |
|
71 | + mkdir($dir.'/config/autoload'); |
|
72 | 72 | |
73 | 73 | chdir($dir); |
74 | 74 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Generated by ZF2's ./bin/classmap_generator.php |
3 | 3 | return array( |
4 | - 'InstallTest\Controller\Plugin\PrerequisitesTest' => __DIR__ . '/InstallTest/Controller/Plugin/PrerequisitesTest.php', |
|
5 | - 'InstallTest\Controller\Plugin\YawikConfigCreatorTest' => __DIR__ . '/InstallTest/Controller/Plugin/YawikConfigCreatorTest.php', |
|
6 | - 'InstallTest\Form\InstallationTest' => __DIR__ . '/InstallTest/Form/InstallationTest.php', |
|
7 | - 'InstallTest\Validator\MongoDbConnectionStringTest' => __DIR__ . '/InstallTest/Validator/MongoDbConnectionStringTest.php', |
|
4 | + 'InstallTest\Controller\Plugin\PrerequisitesTest' => __DIR__ . '/InstallTest/Controller/Plugin/PrerequisitesTest.php', |
|
5 | + 'InstallTest\Controller\Plugin\YawikConfigCreatorTest' => __DIR__ . '/InstallTest/Controller/Plugin/YawikConfigCreatorTest.php', |
|
6 | + 'InstallTest\Form\InstallationTest' => __DIR__ . '/InstallTest/Form/InstallationTest.php', |
|
7 | + 'InstallTest\Validator\MongoDbConnectionStringTest' => __DIR__ . '/InstallTest/Validator/MongoDbConnectionStringTest.php', |
|
8 | 8 | ); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Generated by ZF2's ./bin/classmap_generator.php |
3 | 3 | return array( |
4 | - 'InstallTest\Controller\Plugin\PrerequisitesTest' => __DIR__ . '/InstallTest/Controller/Plugin/PrerequisitesTest.php', |
|
5 | - 'InstallTest\Controller\Plugin\YawikConfigCreatorTest' => __DIR__ . '/InstallTest/Controller/Plugin/YawikConfigCreatorTest.php', |
|
6 | - 'InstallTest\Form\InstallationTest' => __DIR__ . '/InstallTest/Form/InstallationTest.php', |
|
7 | - 'InstallTest\Validator\MongoDbConnectionStringTest' => __DIR__ . '/InstallTest/Validator/MongoDbConnectionStringTest.php', |
|
4 | + 'InstallTest\Controller\Plugin\PrerequisitesTest' => __DIR__.'/InstallTest/Controller/Plugin/PrerequisitesTest.php', |
|
5 | + 'InstallTest\Controller\Plugin\YawikConfigCreatorTest' => __DIR__.'/InstallTest/Controller/Plugin/YawikConfigCreatorTest.php', |
|
6 | + 'InstallTest\Form\InstallationTest' => __DIR__.'/InstallTest/Form/InstallationTest.php', |
|
7 | + 'InstallTest\Validator\MongoDbConnectionStringTest' => __DIR__.'/InstallTest/Validator/MongoDbConnectionStringTest.php', |
|
8 | 8 | ); |
@@ -76,9 +76,9 @@ |
||
76 | 76 | class CreateAssertionMock extends CreateAssertion |
77 | 77 | { |
78 | 78 | public function assert(Acl $acl, |
79 | - RoleInterface $role = null, |
|
80 | - ResourceInterface $resource = null, |
|
81 | - $privilege = null |
|
79 | + RoleInterface $role = null, |
|
80 | + ResourceInterface $resource = null, |
|
81 | + $privilege = null |
|
82 | 82 | ) { |
83 | 83 | return parent::preAssert($acl, $role, $resource, $privilege); |
84 | 84 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function testFreeValuesKeysCanBeSetThroughConstructor() |
42 | 42 | { |
43 | - $keys = [ 'key1', 'key2' ]; |
|
43 | + $keys = ['key1', 'key2']; |
|
44 | 44 | $target = new TemplateValuesHydrator($keys); |
45 | 45 | |
46 | 46 | $this->assertAttributeEquals($keys, 'freeValuesKeys', $target); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function testSetAndGetFreeValuesKeys() |
53 | 53 | { |
54 | 54 | $target = new TemplateValuesHydrator(); |
55 | - $keys = [ 'key1', 'key2' ]; |
|
55 | + $keys = ['key1', 'key2']; |
|
56 | 56 | |
57 | 57 | $this->assertSame($target, $target->setFreeValuesKeys($keys), 'Fluent interface broken.'); |
58 | 58 | $this->assertEquals($keys, $target->getFreeValuesKeys()); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $values->freeKey1 = 'value1'; |
68 | 68 | $values->ignoredKey = 'irrelephant'; |
69 | 69 | |
70 | - $target = new TemplateValuesHydrator([ 'freeKey1' ]); |
|
70 | + $target = new TemplateValuesHydrator(['freeKey1']); |
|
71 | 71 | |
72 | 72 | $data = $target->extract($values); |
73 | 73 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function testHydrate() |
83 | 83 | { |
84 | 84 | $values = new TemplateValues(); |
85 | - $target = new TemplateValuesHydrator([ 'testKeyOne' ]); |
|
85 | + $target = new TemplateValuesHydrator(['testKeyOne']); |
|
86 | 86 | $data = [ |
87 | 87 | 'testKeyOne' => 'testValue', |
88 | 88 | 'ignoredKey' => 'irrelevant' |