diff --git a/composer.json b/composer.json index 3ade071b..4c3866f8 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,12 @@ } ], "require": { - "cakephp/cakephp": "^5.0" + "cakephp/cakephp": "^5.1" }, "require-dev": { - "phpunit/phpunit": "^10.1", + "phpunit/phpunit": "^10.5.5 || ^11.1.3", "cakephp/bake": "^3.0", - "cakephp/cakephp-codesniffer": "^5.0" + "cakephp/cakephp-codesniffer": "^5.1" }, "support": { "issues": "http://github.com/friendsofcake/bootstrap-ui/issues", diff --git a/src/View/Helper/FormHelper.php b/src/View/Helper/FormHelper.php index f239b314..5ad94347 100644 --- a/src/View/Helper/FormHelper.php +++ b/src/View/Helper/FormHelper.php @@ -901,7 +901,6 @@ protected function _ariaOptions(string $fieldName, array $options): array $options['type'] === 'hidden' || ($options['type'] === 'select' && isset($options['multiple']) && $options['multiple'] === 'checkbox') || ( - isset($options['aria-required']) && isset($options['aria-describedby']) && isset($options['aria-invalid']) ) diff --git a/tests/TestCase/Command/InstallCommandTest.php b/tests/TestCase/Command/InstallCommandTest.php index d88bd324..113648bd 100644 --- a/tests/TestCase/Command/InstallCommandTest.php +++ b/tests/TestCase/Command/InstallCommandTest.php @@ -574,12 +574,12 @@ public function testNPMInstallFailure() $command ->expects($this->once()) ->method('_runNPMInstall') - ->will($this->returnCallback(function (&$out, &$return) { + ->willReturnCallback(function (&$out, &$return) { $out = [ 'installer output', ]; $return = 1234; - })); + }); $out = new StubConsoleOutput(); $err = new StubConsoleOutput(); diff --git a/tests/TestCase/View/Helper/FlashHelperTest.php b/tests/TestCase/View/Helper/FlashHelperTest.php index 30f899dc..55ee5c1b 100644 --- a/tests/TestCase/View/Helper/FlashHelperTest.php +++ b/tests/TestCase/View/Helper/FlashHelperTest.php @@ -8,6 +8,7 @@ use Cake\Http\Session; use Cake\TestSuite\TestCase; use Cake\View\View; +use PHPUnit\Framework\Attributes\DataProvider; use UnexpectedValueException; /** @@ -63,11 +64,11 @@ public static function flashTypeDefaultsDataProvider(): array } /** - * @dataProvider flashTypeDefaultsDataProvider * @param string $type The flash type. * @param string $class The alert class. * @param string $icon The icon name. */ + #[DataProvider('flashTypeDefaultsDataProvider')] public function testRenderDefaults(string $type, string $class, string $icon) { $this->View->getRequest()->getSession()->write('Flash', [ @@ -445,9 +446,9 @@ public static function flashTypeDataProvider(): array } /** - * @dataProvider flashTypeDataProvider * @param string $type The flash type. */ + #[DataProvider('flashTypeDataProvider')] public function testCustomDefaultIcon(string $type) { $this->Flash->setConfig('icon', 'info'); @@ -466,9 +467,9 @@ public function testCustomDefaultIcon(string $type) } /** - * @dataProvider flashTypeDataProvider * @param string $type The flash type. */ + #[DataProvider('flashTypeDataProvider')] public function testDisableIconsViaConfig(string $type) { $this->Flash->setConfig('icon', false); @@ -490,6 +491,7 @@ public function testDisableIconsViaConfig(string $type) * @dataProvider flashTypeDataProvider * @param string $type The flash type. */ + #[DataProvider('flashTypeDataProvider')] public function testDisableIconViaParamsOption(string $type) { $this->View->getRequest()->getSession()->write('Flash', [ @@ -508,9 +510,9 @@ public function testDisableIconViaParamsOption(string $type) } /** - * @dataProvider flashTypeDataProvider * @param string $type The flash type. */ + #[DataProvider('flashTypeDataProvider')] public function testCustomIconClassMap(string $type) { $iconClassMap = [ @@ -540,9 +542,9 @@ public function testCustomIconClassMap(string $type) } /** - * @dataProvider flashTypeDataProvider * @param string $type The flash type. */ + #[DataProvider('flashTypeDataProvider')] public function testCustomIconClassMapOptions(string $type) { $options = [ diff --git a/tests/TestCase/View/Helper/Types/ClassesTest.php b/tests/TestCase/View/Helper/Types/ClassesTest.php index 901b5569..e4a095c2 100644 --- a/tests/TestCase/View/Helper/Types/ClassesTest.php +++ b/tests/TestCase/View/Helper/Types/ClassesTest.php @@ -5,17 +5,18 @@ use BootstrapUI\View\Helper\Types\Classes; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\CoversMethod; /** * ClassesTest */ +#[CoversMethod('\BootstrapUI\View\Helper\Types\Classes', 'values')] class ClassesTest extends TestCase { /** * Test get elements * * @return void - * @covers \BootstrapUI\View\Helper\Types\Classes::values */ public function testGetElements() { diff --git a/tests/TestCase/View/Helper/Types/ElementTest.php b/tests/TestCase/View/Helper/Types/ElementTest.php index 461099de..447515b1 100644 --- a/tests/TestCase/View/Helper/Types/ElementTest.php +++ b/tests/TestCase/View/Helper/Types/ElementTest.php @@ -5,17 +5,18 @@ use BootstrapUI\View\Helper\Types\Element; use Cake\TestSuite\TestCase; +use PHPUnit\Framework\Attributes\CoversMethod; /** * ElementTest */ +#[CoversMethod('\BootstrapUI\View\Helper\Types\Element', 'values')] class ElementTest extends TestCase { /** * Test get elements * * @return void - * @covers \BootstrapUI\View\Helper\Types\Element::values */ public function testGetElements() {