Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
I'm not sure how this passed in the first place, it seems to have been out of sync since it was first merged o_O
  • Loading branch information
shish committed Jan 19, 2025
1 parent 0dddc07 commit 4362e78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions generator/tests/MethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ public function testGetTypeHintFromResource(): void
$this->assertEquals('', $params[0]->getSignatureType());
$this->assertEquals('int', $params[1]->getDocBlockType());
$this->assertEquals('int', $params[1]->getSignatureType());

$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/hash/functions/hash-update.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE);
$params = $method->getParams();
$this->assertEquals('\HashContext', $params[0]->getDocBlockType());
$this->assertEquals('\HashContext', $params[0]->getSignatureType());
}

public function testImapOpen5Parameter(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/imap/functions/imap-open.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE);
$params = $method->getParams();
$this->assertEquals('array', $params[5]->getDocBlockType());
$this->assertEquals('array', $params[5]->getSignatureType());
$this->assertEquals('array', $params[5]->getSignatureType());
}

public function testGetInitializer(): void
Expand All @@ -96,7 +96,7 @@ public function testGetInitializer(): void
$this->assertEquals('', $params[0]->getDefaultValue());
$this->assertEquals('false', $params[1]->getDefaultValue());
}

public function testGetReturnDocBlock(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml');
Expand All @@ -122,6 +122,6 @@ public function testOpensslCipherKeyLengthUnionTypeReturnDocBlocks(): void
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/openssl/functions/openssl-cipher-key-length.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE);
$this->assertEquals("@return int Returns the cipher length on success, or false on failure.\n", $method->getReturnDocBlock());
$this->assertEquals("@return int Returns the cipher length on success.\n", $method->getReturnDocBlock());
}
}

0 comments on commit 4362e78

Please sign in to comment.