Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Oct 5, 2020
1 parent 3d9676c commit db4d5bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
54 changes: 0 additions & 54 deletions tests/Config/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,60 +595,6 @@ public function testImpossibleIssue(): void
);
}

public function testRequireVoidReturnTypeExists(): void
{
$this->expectExceptionMessage('MissingReturnType');
$this->expectException(\Psalm\Exception\CodeException::class);
$this->project_analyzer = $this->getProjectAnalyzerWithConfig(
TestConfig::loadFromXML(
dirname(__DIR__, 2),
'<?xml version="1.0"?>
<psalm
requireVoidReturnType="true">
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>'
)
);

$file_path = getcwd() . '/src/somefile.php';

$this->addFile(
$file_path,
'<?php
function foo() {}'
);

$this->analyzeFile($file_path, new Context());
}

public function testDoNotRequireVoidReturnTypeExists(): void
{
$this->project_analyzer = $this->getProjectAnalyzerWithConfig(
TestConfig::loadFromXML(
dirname(__DIR__, 2),
'<?xml version="1.0"?>
<psalm
requireVoidReturnType="false">
<projectFiles>
<directory name="src" />
</projectFiles>
</psalm>'
)
);

$file_path = getcwd() . '/src/somefile.php';

$this->addFile(
$file_path,
'<?php
function foo() {}'
);

$this->analyzeFile($file_path, new Context());
}

public function testThing(): void
{
$this->project_analyzer = $this->getProjectAnalyzerWithConfig(
Expand Down
2 changes: 1 addition & 1 deletion tests/EndToEnd/PsalmEndToEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function testLegacyConfigWithoutresolveFromConfigFile(): void
$this->runPsalmInit(1);
$psalmXmlContent = file_get_contents(self::$tmpDir . '/psalm.xml');
$count = 0;
$psalmXmlContent = preg_replace('/resolveFromConfigFile="true"/', '', $psalmXmlContent, -1, $count);
$psalmXmlContent = preg_replace('/resolveFromConfigFile="true"/', 'resolveFromConfigFile="false"', $psalmXmlContent, -1, $count);
$this->assertEquals(1, $count);

file_put_contents(self::$tmpDir . '/src/psalm.xml', $psalmXmlContent);
Expand Down

0 comments on commit db4d5bc

Please sign in to comment.