Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPCBF: Fixed several CS errors in tests. #100

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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());
}

}