Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"permissions": {
"allow": [
"Bash(cat:*)",
"Bash(composer install:*)",
"Bash(composer tests:*)",
"Bash(make test:*)",
"Bash(make test-all:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git rebase:*)",
"Bash(git stash:*)"
]
}
}
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.2'
version: '3.0'
- php: '8.2'
version: '3.1'
- php: '8.4'
version: '3.2'

name: PHP ${{ matrix.php }} / ${{ matrix.version }}

steps:
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- run: composer install --no-interaction --optimize-autoloader
working-directory: ${{ matrix.version }}

- run: composer tests
working-directory: ${{ matrix.version }}

- if: failure()
run: for i in $(find tests -name '*.actual'); do echo "--- $i"; cat "$i"; echo; done
working-directory: ${{ matrix.version }}
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions 2.3/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"require-dev": {
"php": "<=7.2",
"nette/di": "~2.3.0",
"ninjify/nunjuck": "~0.2.0"
"php": ">=5.6 <7.3",
"nette/di": "^2.3",
"ninjify/nunjuck": "^0.3"
},
"autoload-dev": {
"classmap": [
Expand Down
8 changes: 2 additions & 6 deletions 2.3/misc/ITestInferface3.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface3
{

/**
* @param string $c
* @return TestClass2
*/
function create($c);
function create($c): TestClass2;
}
7 changes: 2 additions & 5 deletions 2.3/misc/ITestInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface
{

/**
* @return TestClass
*/
function create();
function create(): TestClass;
}
7 changes: 2 additions & 5 deletions 2.3/misc/ITestInterface2.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface2
{

/**
* @return TestClass2
*/
function create();
function create(): TestClass2;
}
7 changes: 2 additions & 5 deletions 2.3/misc/ITestInterfaceGet.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterfaceGet
{

/**
* @return TestClass2
*/
function get();
function get(): TestClass2;
}
2 changes: 1 addition & 1 deletion 2.3/misc/TestClass.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

class TestClass
{
Expand Down
2 changes: 1 addition & 1 deletion 2.3/misc/TestClass2.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

class TestClass2
{
Expand Down
5 changes: 1 addition & 4 deletions 2.3/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types = 1);
<?php declare(strict_types=1);

use Ninjify\Nunjuck\Environment;

Expand All @@ -11,6 +11,3 @@
Environment::setupTester();
Environment::setupTimezone();
Environment::setupVariables(__DIR__);

// Ignore E_USER_DEPRECATED: Replace deprecated Nette\Object with trait Nette\SmartObject
error_reporting(~E_USER_DEPRECATED);
32 changes: 6 additions & 26 deletions 2.3/tests/cases/Compare.phpt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types = 1);
<?php declare(strict_types=1);

use Nette\DI\Compiler;
use Nette\DI\Container;
Expand Down Expand Up @@ -57,29 +57,17 @@ class CompareTest extends TestCase
$this->assertMethods($container1, $container2);
}

/**
* @param array $m1
* @param array $m2
*/
protected function assertAliases(array $m1, array $m2)
protected function assertAliases(array $m1, array $m2): void
{
Assert::equal($m1['aliases'], $m2['aliases']);
}

/**
* @param array $m1
* @param array $m2
*/
protected function assertServices(array $m1, array $m2)
protected function assertServices(array $m1, array $m2): void
{
Assert::equal($m1['services'], $m2['services']);
}

/**
* @param array $m1
* @param array $m2
*/
protected function assertTags(array $m1, array $m2)
protected function assertTags(array $m1, array $m2): void
{
$tags1 = $m1['tags'];
$tags2 = $m2['tags'];
Expand All @@ -89,11 +77,7 @@ class CompareTest extends TestCase
}
}

/**
* @param array $m1
* @param array $m2
*/
protected function assertTypes(array $m1, array $m2)
protected function assertTypes(array $m1, array $m2): void
{
$types1 = $m1['types'];
$types2 = $m2['types'];
Expand All @@ -113,11 +97,7 @@ class CompareTest extends TestCase
}
}

/**
* @param Container $container1
* @param Container $container2
*/
protected function assertMethods(Container $container1, Container $container2)
protected function assertMethods(Container $container1, Container $container2): void
{
$rc1 = new ReflectionClass($container1);
$rc2 = new ReflectionClass($container2);
Expand Down
15 changes: 3 additions & 12 deletions 2.3/tests/cases/LineCompare.phpt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php declare(strict_types = 1);
<?php declare(strict_types=1);

use Nette\DI\Compiler;
use Nette\DI\ContainerLoader;
use Tester\Assert;
use Tester\AssertException;
use Tester\TestCase;

require __DIR__ . '/../bootstrap.php';
Expand All @@ -24,7 +23,7 @@ class CompareLoader extends ContainerLoader
class LineCompareTest extends TestCase
{

public function testCompareLines()
public function testCompareLines(): void
{
// Create container based on extension
$loader = new CompareLoader();
Expand All @@ -49,18 +48,10 @@ class LineCompareTest extends TestCase
$code2 = preg_replace('#^(.*)public function#sU', null, $code2);
$code2 = preg_replace('#(public function initialize.*})#sU', null, $code2);

//file_put_contents(TEMP_DIR . '/Container1.php', $code1);
//file_put_contents(TEMP_DIR . '/Container2.php', $code2);

$this->assertLines(explode(PHP_EOL, $code1), explode(PHP_EOL, $code2));
}

/**
* @param array $code1
* @param array $code2
* @throws AssertException
*/
protected function assertLines(array $code1, array $code2)
protected function assertLines(array $code1, array $code2): void
{
if (count($code1) !== count($code2)) {
Assert::fail('Containers have not same number of lines.');
Expand Down
4 changes: 2 additions & 2 deletions 2.4/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"require-dev": {
"php": ">=7.1",
"nette/di": "~2.4.0",
"ninjify/nunjuck": "~0.2.0"
"nette/di": "^2.4",
"ninjify/nunjuck": "^0.4"
},
"autoload-dev": {
"classmap": [
Expand Down
8 changes: 2 additions & 6 deletions 2.4/misc/ITestInferface3.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface3
{

/**
* @param string $c
* @return TestClass2
*/
function create($c);
function create($c): TestClass2;
}
7 changes: 2 additions & 5 deletions 2.4/misc/ITestInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface
{

/**
* @return TestClass
*/
function create();
function create(): TestClass;
}
7 changes: 2 additions & 5 deletions 2.4/misc/ITestInterface2.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterface2
{

/**
* @return TestClass2
*/
function create();
function create(): TestClass2;
}
7 changes: 2 additions & 5 deletions 2.4/misc/ITestInterfaceGet.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<?php
<?php declare(strict_types=1);

interface ITestInterfaceGet
{

/**
* @return TestClass2
*/
function get();
function get(): TestClass2;
}
2 changes: 1 addition & 1 deletion 2.4/misc/TestClass.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

class TestClass
{
Expand Down
2 changes: 1 addition & 1 deletion 2.4/misc/TestClass2.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types=1);

class TestClass2
{
Expand Down
2 changes: 1 addition & 1 deletion 2.4/tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types = 1);
<?php declare(strict_types=1);

use Ninjify\Nunjuck\Environment;

Expand Down
Loading