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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ on:

jobs:
tests:
name: PHPUnit (PHP ${{ matrix.php-version }})
name: PHPUnit (PHP ${{ matrix.php-version }}${{ matrix.lowest && ', lowest deps' || '' }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.3', '8.4']
lowest: [false]
include:
- php-version: '8.3'
lowest: true
steps:
- uses: actions/checkout@v4

Expand All @@ -23,7 +27,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
run: composer ${{ matrix.lowest && 'update --prefer-lowest' || 'install' }} --no-interaction --no-progress --prefer-dist

- name: Run PHPUnit
run: vendor/bin/phpunit tests
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.5.5] - 2026-10-02

### Fixed
- nette/forms 3.1 compatibility: overridden `getValues()`, `addSelect()`, `addMultiSelect()`, `addSubmit()` and `addButton()` no longer narrow parent parameter types (fatal error since 3.5.0)
- `{neoForm}` tag compiles again with latte 3.0 / nette/forms < 3.3
- Declared missing `nette/component-model` ^3.1 requirement (`getComponentTree()`)

## [3.5.4] - 2026-07-01

### Fixed
Expand Down
38 changes: 38 additions & 0 deletions tests/LoadClassesTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace Tests\Efabrica\NeoForms;

use Efabrica\NeoForms\DI\NeoFormLatteExtension;
use Latte\Engine;
use Latte\Loaders\StringLoader;
use PHPUnit\Framework\TestCase;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

/**
* Signature mismatches with nette/forms only fatal when a class is loaded, so load them all.
* Run with `composer update --prefer-lowest` to catch too-loose version constraints.
*/
class LoadClassesTest extends TestCase
{
public function testAllClassesLoad(): void
{
$src = dirname(__DIR__) . '/src/';
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($src)) as $file) {
// Latte 2 macro set, its parent classes no longer exist
if ($file->getExtension() !== 'php' || $file->getFilename() === 'NeoFormMacroSet.php') {
continue;
}
$class = 'Efabrica\\NeoForms\\' . strtr(substr($file->getPathname(), strlen($src), -4), '/', '\\');
$this->assertTrue(class_exists($class) || trait_exists($class) || interface_exists($class), $class);
}
}

public function testNeoFormTagCompiles(): void
{
$latte = new Engine();
$latte->setLoader(new StringLoader());
$latte->addExtension(new NeoFormLatteExtension());
$this->assertStringContainsString('neoFormRenderer', $latte->compile("{neoForm foo}\n{formRow bar}\n{/neoForm}"));
}
}
Loading