Skip to content

Commit

Permalink
PHPCBF: Fixed several CS errors in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
BasilSnowman committed Mar 13, 2019
1 parent 67b654c commit 314be98
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
3 changes: 2 additions & 1 deletion generator/tests/DocPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

class DocPageTest extends TestCase
{
public function testDetectFalsyFunction() {
public function testDetectFalsyFunction()
{
$pregMatch = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$implode = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/strings/functions/implode.xml');
$getCwd = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/dir/functions/getcwd.xml');
Expand Down
9 changes: 5 additions & 4 deletions generator/tests/GeneratedFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public function testOpenSslSign()
openssl_sign('foo', $signatureSafe, file_get_contents(__DIR__ . '/fixtures/id_rsa'));

$this->assertSame($signature, $signatureSafe);

}

public function testOpenSslEncrypt()
Expand All @@ -128,15 +127,17 @@ public function testOpenSslEncrypt()
'aes-256-cbc',
pack('H*', 'a2e8ccd0e7985cc0b6213a55815a1034afc252980e970ca90e5202689f9473b0'),
\OPENSSL_RAW_DATA,
pack('H*', '123ce954203b7caaaa9da67f59839456'));
pack('H*', '123ce954203b7caaaa9da67f59839456')
);

$resultSafe = openssl_encrypt(
'test',
'aes-256-cbc',
pack('H*', 'a2e8ccd0e7985cc0b6213a55815a1034afc252980e970ca90e5202689f9473b0'),
\OPENSSL_RAW_DATA,
pack('H*', '123ce954203b7caaaa9da67f59839456'));
pack('H*', '123ce954203b7caaaa9da67f59839456')
);

$this->assertSame($result, $resultSafe);
}
}
}
13 changes: 8 additions & 5 deletions generator/tests/MethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,26 @@

class MethodTest extends TestCase
{
public function testGetFunctionName() {
public function testGetFunctionName()
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader());
$name = $method->getFunctionName();
$this->assertEquals('preg_match', $name);
}

public function testGetFunctionType() {
public function testGetFunctionType()
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader());
$type = $method->getReturnType();
$this->assertEquals('int', $type);
}

public function testGetFunctionParam() {
public function testGetFunctionParam()
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader());
Expand All @@ -32,13 +35,13 @@ public function testGetFunctionParam() {
$this->assertEquals('pattern', $params[0]->getParameter());
}

public function testGetInitializer() {
public function testGetInitializer()
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/apc/functions/apc-cache-info.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader());

$params = $method->getParams();
$this->assertEquals('', $params[0]->getDefaultValue());
}

}

0 comments on commit 314be98

Please sign in to comment.