Skip to content

Commit

Permalink
Do not export test files
Browse files Browse the repository at this point in the history
- Use gitattributes to not export test files
- Updates dependencies to not export the test files
  • Loading branch information
dantleech committed Jun 3, 2024
1 parent 9db45c9 commit 069b55e
Show file tree
Hide file tree
Showing 360 changed files with 32 additions and 27,094 deletions.
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Handle line endings automatically for files detected as text and leave all
# files detected as binary untouched.
* text=auto

# Files and directories with the attribute export-ignore won’t be added to
# archive files. See http://git-scm.com/docs/gitattributes for details.
.gitattributes export-ignore
.gitignore export-ignore
/*.neon export-ignore
/.github export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpunit.xml.dist export-ignore
/tests/ export-ignore
12 changes: 12 additions & 0 deletions bin/update.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env php
<?php

use Symfony\Component\Filesystem\Filesystem;

require __DIR__ . '/../vendor/autoload.php';

$fs = new Filesystem();
$fs->remove('src');
$fs->remove('tests');
$fs->mirror('../phpactor/lib/WorseReflection', 'src');
$fs->mirror('src/Tests', 'tests');
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"phpactor/tolerant-php-parser": "dev-main",

"amphp/amp": "^2.6",
"phpactor/text-document": "^2.0.0",
"phpactor/docblock-parser": "^0.1.0",
"phpactor/text-document": "^2.1.0",
"phpactor/docblock-parser": "^0.2.0",
"psr/log": "^1.0"
},
"require-dev": {
Expand Down
7 changes: 2 additions & 5 deletions src/Core/Inference/Walker/TestAssertWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Microsoft\PhpParser\Node\Expression\ArgumentExpression;
use Microsoft\PhpParser\Node\Expression\CallExpression;
use PHPUnit\Framework\TestCase;
use Phpactor\Extension\LanguageServerBridge\Converter\PositionConverter;
use Phpactor\TextDocument\ByteOffset;
use Phpactor\WorseReflection\Bridge\TolerantParser\TextDocument\NodeToTextDocumentConverter;
use Phpactor\WorseReflection\Core\Inference\Frame;
use Phpactor\WorseReflection\Core\Inference\FrameResolver;
Expand Down Expand Up @@ -196,19 +196,16 @@ private function resolveArgs(?ArgumentExpressionList $argList, FrameResolver $re
private function assertTypeIs(Node $node, Type $actualType, Type $expectedType, ?NodeContext $message = null): void
{
$message = isset($message) ? TypeUtil::valueOrNull($message->type()) : null;
$position = PositionConverter::intByteOffsetToPosition($node->getStartPosition(), $node->getFileContents());
if ($actualType->__toString() === TypeUtil::valueOrNull($expectedType)) {
$this->testCase->addToAssertionCount(1);
return;
}
$this->testCase->fail(sprintf(
"%s: \n\n %s\n\nis:\n\n %s\n\non offset %s line %s char %s",
"%s: \n\n %s\n\nis:\n\n %s\n\non offset %s",
$message ?: 'Failed asserting that:',
$actualType->__toString(),
trim($expectedType->__toString(), '"'),
$node->getStartPosition(),
$position->line + 1,
$position->character + 1,
));
}
}
23 changes: 0 additions & 23 deletions src/Tests/Assert/TrinaryAssert.php

This file was deleted.

13 changes: 0 additions & 13 deletions src/Tests/Benchmarks/AnalyserBench.php

This file was deleted.

68 changes: 0 additions & 68 deletions src/Tests/Benchmarks/BaseBenchCase.php

This file was deleted.

53 changes: 0 additions & 53 deletions src/Tests/Benchmarks/DiagnosticsBench.php

This file was deleted.

21 changes: 0 additions & 21 deletions src/Tests/Benchmarks/Examples/MethodClass.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Tests/Benchmarks/Examples/PropertyClass.php

This file was deleted.

53 changes: 0 additions & 53 deletions src/Tests/Benchmarks/PhpUnitReflectClassBench.php

This file was deleted.

47 changes: 0 additions & 47 deletions src/Tests/Benchmarks/ReflectMethodBench.php

This file was deleted.

Loading

0 comments on commit 069b55e

Please sign in to comment.