Skip to content

Commit

Permalink
Add tests for PHP 7.0, 7.1 and 7.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomzx committed Dec 9, 2017
1 parent b490d73 commit 11bab19
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/PHPSemVerChecker/Scanner/ScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,28 @@ public function testInvalidCodeParsing()
$scanner = new Scanner();
$scanner->scan(__DIR__.'/../../fixtures/general/InvalidCode.php');
}

public function testPHP70()
{
$scanner = new Scanner();
$scanner->scan(__DIR__.'/../../fixtures/general/PHP7.0.php');

$this->assertTrue(true);
}

public function testPHP71()
{
$scanner = new Scanner();
$scanner->scan(__DIR__.'/../../fixtures/general/PHP7.1.php');

$this->assertTrue(true);
}

public function testPHP72()
{
$scanner = new Scanner();
$scanner->scan(__DIR__.'/../../fixtures/general/PHP7.2.php');

$this->assertTrue(true);
}
}
31 changes: 31 additions & 0 deletions tests/fixtures/general/PHP7.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

function testScalarTypes(string $test)
{

}

function testReturnType(): array
{
return [];
}

function testNullCoalescingOperator()
{
return 1 ?? 2;
}

function testSpaceshipOperator()
{
return 1 <=> 1;
}

function testAnonymousClass()
{
new class {
public function test()
{

}
};
}
11 changes: 11 additions & 0 deletions tests/fixtures/general/PHP7.1.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

function testNullableTypes(?string $test)
{

}

function testNullFunctions(): void
{

}
6 changes: 6 additions & 0 deletions tests/fixtures/general/PHP7.2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

function testNewObjectType(): object
{

}

0 comments on commit 11bab19

Please sign in to comment.