Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Feb 9, 2025
1 parent 7b61043 commit d72977b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions generator/src/Generator/ComposerJsonEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public static function editComposerFileForGeneration(array $modules): void
\file_put_contents(FileCreator::getSafeRootDir() . '/composer.json', $newContent);
}




/**
* @param string[] $oldFiles
* @param string[] $modules A list of modules
Expand Down
8 changes: 8 additions & 0 deletions generator/tests/XmlDocParser/MethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

class MethodTest extends TestCase
{
public function testToString(): void
{
$docPage = new DocPage(DocPage::findReferenceDir() . '/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), ErrorType::FALSY);
$this->assertStringContainsString('Error type: FALSY', (string)$method);
}

public function testGetFunctionName(): void
{
$docPage = new DocPage(DocPage::findReferenceDir() . '/pcre/functions/preg-match.xml');
Expand Down
1 change: 1 addition & 0 deletions generator/tests/XmlDocParser/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public function testIsClass(): void
$this->assertSame('\\SimpleXMLElement', Type::toRootNamespace('SimpleXMLElement'));
$this->assertSame('bool', Type::toRootNamespace('bool'));
$this->assertSame('int', Type::toRootNamespace('int'));
$this->assertSame('', Type::toRootNamespace(''));
}
}

0 comments on commit d72977b

Please sign in to comment.