diff --git a/.travis.yml b/.travis.yml
index ddf708af8..c2e0eff61 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,5 @@
language: php
php:
- - 5.4
- - 5.5
- 5.6
- 7.0
- hhvm
@@ -12,7 +10,7 @@ matrix:
- php: hhvm
include:
- - php: 5.5
+ - php: 5.6
env: dependencies="--prefer-lowest --prefer-stable"
script:
diff --git a/composer.json b/composer.json
index 6761881b0..f145a3f30 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,7 @@
}
],
"require": {
- "php": ">=5.4.4",
+ "php": ">=5.6.0",
"nette/component-model": "~2.2",
"nette/http": "~2.2",
"nette/utils": "~2.2"
diff --git a/src/Bridges/FormsLatte/Runtime.php b/src/Bridges/FormsLatte/Runtime.php
index 18ed2c5ae..c155bca5d 100644
--- a/src/Bridges/FormsLatte/Runtime.php
+++ b/src/Bridges/FormsLatte/Runtime.php
@@ -56,13 +56,13 @@ public static function renderFormEnd(Form $form, $withTags = TRUE)
}
}
- foreach ($form->getComponents(TRUE, 'Nette\Forms\Controls\HiddenField') as $control) {
+ foreach ($form->getComponents(TRUE, Nette\Forms\Controls\HiddenField::class) as $control) {
if (!$control->getOption('rendered')) {
$s .= $control->getControl();
}
}
- if (iterator_count($form->getComponents(TRUE, 'Nette\Forms\Controls\TextInput')) < 2) {
+ if (iterator_count($form->getComponents(TRUE, Nette\Forms\Controls\TextInput::class)) < 2) {
$s .= "\n";
}
diff --git a/src/Forms/Container.php b/src/Forms/Container.php
index cb08b8720..d7da524fe 100644
--- a/src/Forms/Container.php
+++ b/src/Forms/Container.php
@@ -207,7 +207,7 @@ public function addComponent(Nette\ComponentModel\IComponent $component, $name,
*/
public function getControls()
{
- return $this->getComponents(TRUE, 'Nette\Forms\IControl');
+ return $this->getComponents(TRUE, IControl::class);
}
@@ -218,7 +218,7 @@ public function getControls()
*/
public function getForm($need = TRUE)
{
- return $this->lookup('Nette\Forms\Form', $need);
+ return $this->lookup(Form::class, $need);
}
diff --git a/src/Forms/Controls/BaseControl.php b/src/Forms/Controls/BaseControl.php
index 02c4c1a7a..219eca054 100644
--- a/src/Forms/Controls/BaseControl.php
+++ b/src/Forms/Controls/BaseControl.php
@@ -75,7 +75,7 @@ abstract class BaseControl extends Nette\ComponentModel\Component implements ICo
*/
public function __construct($caption = NULL)
{
- $this->monitor('Nette\Forms\Form');
+ $this->monitor(Form::class);
parent::__construct();
$this->control = Html::el('input', ['type' => NULL, 'name' => NULL]);
$this->label = Html::el('label');
@@ -105,7 +105,7 @@ protected function attached($form)
*/
public function getForm($need = TRUE)
{
- return $this->lookup('Nette\Forms\Form', $need);
+ return $this->lookup(Form::class, $need);
}
@@ -135,7 +135,7 @@ public function getHttpData($type, $htmlTail = NULL)
*/
public function getHtmlName()
{
- return Nette\Forms\Helpers::generateHtmlName($this->lookupPath('Nette\Forms\Form'));
+ return Nette\Forms\Helpers::generateHtmlName($this->lookupPath(Form::class));
}
diff --git a/src/Forms/Controls/CsrfProtection.php b/src/Forms/Controls/CsrfProtection.php
index fbd4700d0..b4ab09390 100644
--- a/src/Forms/Controls/CsrfProtection.php
+++ b/src/Forms/Controls/CsrfProtection.php
@@ -29,7 +29,7 @@ public function __construct($message)
{
parent::__construct();
$this->setOmitted()->addRule(self::PROTECTION, $message);
- $this->monitor('Nette\Application\UI\Presenter');
+ $this->monitor(Nette\Application\UI\Presenter::class);
}
diff --git a/src/Forms/Controls/HiddenField.php b/src/Forms/Controls/HiddenField.php
index 276a2dcf9..8e4e641dd 100644
--- a/src/Forms/Controls/HiddenField.php
+++ b/src/Forms/Controls/HiddenField.php
@@ -24,7 +24,7 @@ public function __construct($persistentValue = NULL)
parent::__construct();
$this->control->type = 'hidden';
if ($persistentValue !== NULL) {
- $this->unmonitor('Nette\Forms\Form');
+ $this->unmonitor(Nette\Forms\Form::class);
$this->persistValue = TRUE;
$this->value = (string) $persistentValue;
}
diff --git a/src/Forms/Controls/SubmitButton.php b/src/Forms/Controls/SubmitButton.php
index b6d0a8676..3efd12818 100644
--- a/src/Forms/Controls/SubmitButton.php
+++ b/src/Forms/Controls/SubmitButton.php
@@ -112,7 +112,7 @@ public function getControl($caption = NULL)
{
$scope = [];
foreach ((array) $this->validationScope as $control) {
- $scope[] = $control->lookupPath('Nette\Forms\Form');
+ $scope[] = $control->lookupPath(Nette\Forms\Form::class);
}
return parent::getControl($caption)->addAttributes([
'formnovalidate' => $this->validationScope !== NULL,
diff --git a/src/Forms/Rendering/DefaultFormRenderer.php b/src/Forms/Rendering/DefaultFormRenderer.php
index 79893a978..48f2624de 100644
--- a/src/Forms/Rendering/DefaultFormRenderer.php
+++ b/src/Forms/Rendering/DefaultFormRenderer.php
@@ -193,7 +193,7 @@ public function renderEnd()
$s .= $control->getControl();
}
}
- if (iterator_count($this->form->getComponents(TRUE, 'Nette\Forms\Controls\TextInput')) < 2) {
+ if (iterator_count($this->form->getComponents(TRUE, Nette\Forms\Controls\TextInput::class)) < 2) {
$s .= '';
}
if ($s) {
diff --git a/tests/Forms.DI/FormsExtension.phpt b/tests/Forms.DI/FormsExtension.phpt
index f7bba2d16..5679928e7 100644
--- a/tests/Forms.DI/FormsExtension.phpt
+++ b/tests/Forms.DI/FormsExtension.phpt
@@ -49,4 +49,4 @@ Assert::exception(function () {
', 'neon'));
eval($compiler->compile($config, 'Container2'));
-}, 'Nette\InvalidArgumentException', 'Constant Nette\Forms\Form::Foo\Bar or constant Foo\Bar does not exist.');
+}, Nette\InvalidArgumentException::class, 'Constant Nette\Forms\Form::Foo\Bar or constant Foo\Bar does not exist.');
diff --git a/tests/Forms.Latte/FormMacros.error.phpt b/tests/Forms.Latte/FormMacros.error.phpt
index a91b98a3e..c02c79641 100644
--- a/tests/Forms.Latte/FormMacros.error.phpt
+++ b/tests/Forms.Latte/FormMacros.error.phpt
@@ -18,34 +18,34 @@ FormMacros::install($latte->getCompiler());
Assert::exception(function () use ($latte) {
$latte->compile('
');
-}, 'Latte\CompileException', 'Did you mean ');
-}, 'Latte\CompileException', 'Missing name in n:name.');
+}, Latte\CompileException::class, 'Missing name in n:name.');
Assert::exception(function () use ($latte) {
$latte->compile('');
-}, 'Latte\CompileException', 'Unknown attribute n:inner-name, use n:name attribute.');
+}, Latte\CompileException::class, 'Unknown attribute n:inner-name, use n:name attribute.');
Assert::exception(function () use ($latte) {
$latte->compile('{form /}');
-}, 'Latte\CompileException', 'Missing form name in {form}.');
+}, Latte\CompileException::class, 'Missing form name in {form}.');
Assert::exception(function () use ($latte) {
$latte->compile('{formContainer /}');
-}, 'Latte\CompileException', 'Missing name in {formContainer}.');
+}, Latte\CompileException::class, 'Missing name in {formContainer}.');
Assert::exception(function () use ($latte) {
$latte->compile('{label /}');
-}, 'Latte\CompileException', 'Missing name in {label}.');
+}, Latte\CompileException::class, 'Missing name in {label}.');
Assert::exception(function () use ($latte) {
$latte->compile('{input /}');
-}, 'Latte\CompileException', 'Missing name in {input}.');
+}, Latte\CompileException::class, 'Missing name in {input}.');
Assert::exception(function () use ($latte) {
$latte->compile('{name /}');
-}, 'Latte\CompileException', 'Unknown macro {name}, use n:name attribute.');
+}, Latte\CompileException::class, 'Unknown macro {name}, use n:name attribute.');
diff --git a/tests/Forms/Controls.Button.render.phpt b/tests/Forms/Controls.Button.render.phpt
index 9f4faa5a7..cbe952ba9 100644
--- a/tests/Forms/Controls.Button.render.phpt
+++ b/tests/Forms/Controls.Button.render.phpt
@@ -26,7 +26,7 @@ test(function () {
$input = $form->addButton('button', 'Caption');
Assert::null($input->getLabel());
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
Assert::same('', (string) $input->getControl('Another caption'));
});
@@ -74,7 +74,7 @@ test(function () { // SubmitButton
$input = $form->addSubmit('button', 'Caption');
Assert::null($input->getLabel());
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
Assert::same('', (string) $input->getControl('Another caption'));
});
diff --git a/tests/Forms/Controls.Checkbox.loadData.phpt b/tests/Forms/Controls.Checkbox.loadData.phpt
index c763fa60a..f9919dea5 100644
--- a/tests/Forms/Controls.Checkbox.loadData.phpt
+++ b/tests/Forms/Controls.Checkbox.loadData.phpt
@@ -54,5 +54,5 @@ test(function () { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue([]);
- }, 'Nette\InvalidArgumentException', "Value must be scalar or NULL, array given in field 'checkbox'.");
+ }, Nette\InvalidArgumentException::class, "Value must be scalar or NULL, array given in field 'checkbox'.");
});
diff --git a/tests/Forms/Controls.Checkbox.render.phpt b/tests/Forms/Controls.Checkbox.render.phpt
index 93e179277..530ab5abe 100644
--- a/tests/Forms/Controls.Checkbox.render.phpt
+++ b/tests/Forms/Controls.Checkbox.render.phpt
@@ -27,13 +27,13 @@ test(function () {
Assert::null($input->getLabel());
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
- Assert::type('Nette\Utils\Html', $input->getLabelPart());
+ Assert::type(Nette\Utils\Html::class, $input->getLabelPart());
Assert::same('', (string) $input->getLabelPart());
- Assert::type('Nette\Utils\Html', $input->getControlPart());
+ Assert::type(Nette\Utils\Html::class, $input->getControlPart());
Assert::same('', (string) $input->getControlPart());
$input->setValue(TRUE);
diff --git a/tests/Forms/Controls.CheckboxList.loadData.phpt b/tests/Forms/Controls.CheckboxList.loadData.phpt
index e55b66c69..29274ef2c 100644
--- a/tests/Forms/Controls.CheckboxList.loadData.phpt
+++ b/tests/Forms/Controls.CheckboxList.loadData.phpt
@@ -136,7 +136,7 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'list'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'list'.");
});
diff --git a/tests/Forms/Controls.CheckboxList.render.phpt b/tests/Forms/Controls.CheckboxList.render.phpt
index 342724dd1..b250e855f 100644
--- a/tests/Forms/Controls.CheckboxList.render.phpt
+++ b/tests/Forms/Controls.CheckboxList.render.phpt
@@ -28,17 +28,17 @@ test(function () {
0 => 'Second',
]);
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getLabelPart(0));
+ Assert::type(Nette\Utils\Html::class, $input->getLabelPart(0));
Assert::same('', (string) $input->getLabelPart(0));
Assert::type('string', $input->getControl());
Assert::same('
', $input->getControl());
- Assert::type('Nette\Utils\Html', $input->getControlPart(0));
+ Assert::type(Nette\Utils\Html::class, $input->getControlPart(0));
Assert::same('', (string) $input->getControlPart(0));
});
diff --git a/tests/Forms/Controls.ChoiceControl.loadData.phpt b/tests/Forms/Controls.ChoiceControl.loadData.phpt
index ab0fe46b7..2cb1aa272 100644
--- a/tests/Forms/Controls.ChoiceControl.loadData.phpt
+++ b/tests/Forms/Controls.ChoiceControl.loadData.phpt
@@ -147,7 +147,7 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
});
diff --git a/tests/Forms/Controls.HiddenField.loadData.phpt b/tests/Forms/Controls.HiddenField.loadData.phpt
index 46b33cf50..86779c090 100644
--- a/tests/Forms/Controls.HiddenField.loadData.phpt
+++ b/tests/Forms/Controls.HiddenField.loadData.phpt
@@ -59,7 +59,7 @@ test(function () { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue([]);
- }, 'Nette\InvalidArgumentException', "Value must be scalar or NULL, array given in field 'hidden'.");
+ }, Nette\InvalidArgumentException::class, "Value must be scalar or NULL, array given in field 'hidden'.");
});
diff --git a/tests/Forms/Controls.HiddenField.render.phpt b/tests/Forms/Controls.HiddenField.render.phpt
index 7f8147696..c3aea750a 100644
--- a/tests/Forms/Controls.HiddenField.render.phpt
+++ b/tests/Forms/Controls.HiddenField.render.phpt
@@ -26,7 +26,7 @@ test(function () {
$input = $form->addHidden('hidden', 'value');
Assert::null($input->getLabel());
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.ImageButton.render.phpt b/tests/Forms/Controls.ImageButton.render.phpt
index 0df095d22..570c35d83 100644
--- a/tests/Forms/Controls.ImageButton.render.phpt
+++ b/tests/Forms/Controls.ImageButton.render.phpt
@@ -26,7 +26,7 @@ test(function () {
$input = $form->addImage('button', 'image.gif');
Assert::null($input->getLabel());
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.MultiChoiceControl.loadData.phpt b/tests/Forms/Controls.MultiChoiceControl.loadData.phpt
index 234e0bdde..680ad92fd 100644
--- a/tests/Forms/Controls.MultiChoiceControl.loadData.phpt
+++ b/tests/Forms/Controls.MultiChoiceControl.loadData.phpt
@@ -160,15 +160,15 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
Assert::exception(function () use ($input) {
$input->setValue(new stdClass);
- }, 'Nette\InvalidArgumentException', "Value must be array or NULL, object given in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value must be array or NULL, object given in field 'select'.");
Assert::exception(function () use ($input) {
$input->setValue([new stdClass]);
- }, 'Nette\InvalidArgumentException', "Values must be scalar, object given in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Values must be scalar, object given in field 'select'.");
});
@@ -181,11 +181,11 @@ test(function () use ($series) { // setValue() and disabled $checkAllowedValues
Assert::exception(function () use ($input) {
$input->setValue(new stdClass);
- }, 'Nette\InvalidArgumentException', "Value must be array or NULL, object given in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value must be array or NULL, object given in field 'select'.");
Assert::exception(function () use ($input) {
$input->setValue([new stdClass]);
- }, 'Nette\InvalidArgumentException', "Values must be scalar, object given in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Values must be scalar, object given in field 'select'.");
});
diff --git a/tests/Forms/Controls.MultiSelectBox.loadData.phpt b/tests/Forms/Controls.MultiSelectBox.loadData.phpt
index c2f73ee7f..b868ddd7d 100644
--- a/tests/Forms/Controls.MultiSelectBox.loadData.phpt
+++ b/tests/Forms/Controls.MultiSelectBox.loadData.phpt
@@ -199,7 +199,7 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' are out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
});
diff --git a/tests/Forms/Controls.MultiSelectBox.render.phpt b/tests/Forms/Controls.MultiSelectBox.render.phpt
index 0812987a5..875cecac8 100644
--- a/tests/Forms/Controls.MultiSelectBox.render.phpt
+++ b/tests/Forms/Controls.MultiSelectBox.render.phpt
@@ -28,11 +28,11 @@ test(function () {
0 => 'Second',
]);
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.RadioList.loadData.phpt b/tests/Forms/Controls.RadioList.loadData.phpt
index 9c69013d4..36a8a078b 100644
--- a/tests/Forms/Controls.RadioList.loadData.phpt
+++ b/tests/Forms/Controls.RadioList.loadData.phpt
@@ -136,7 +136,7 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'radio'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'radio'.");
});
diff --git a/tests/Forms/Controls.RadioList.render.phpt b/tests/Forms/Controls.RadioList.render.phpt
index f77d28bdb..bba23436f 100644
--- a/tests/Forms/Controls.RadioList.render.phpt
+++ b/tests/Forms/Controls.RadioList.render.phpt
@@ -28,17 +28,17 @@ test(function () {
0 => 'Second',
]);
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getLabelPart(0));
+ Assert::type(Nette\Utils\Html::class, $input->getLabelPart(0));
Assert::same('', (string) $input->getLabelPart(0));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('
', (string) $input->getControl());
- Assert::type('Nette\Utils\Html', $input->getControlPart(0));
+ Assert::type(Nette\Utils\Html::class, $input->getControlPart(0));
Assert::same('', (string) $input->getControlPart(0));
});
diff --git a/tests/Forms/Controls.SelectBox.loadData.phpt b/tests/Forms/Controls.SelectBox.loadData.phpt
index 738688d29..8358caccd 100644
--- a/tests/Forms/Controls.SelectBox.loadData.phpt
+++ b/tests/Forms/Controls.SelectBox.loadData.phpt
@@ -222,7 +222,7 @@ test(function () use ($series) { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue('unknown');
- }, 'Nette\InvalidArgumentException', "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
+ }, Nette\InvalidArgumentException::class, "Value 'unknown' is out of allowed set ['red-dwarf', 'the-simpsons', 0, ''] in field 'select'.");
});
diff --git a/tests/Forms/Controls.SelectBox.render.phpt b/tests/Forms/Controls.SelectBox.render.phpt
index c74f8bbbb..c9595ba5e 100644
--- a/tests/Forms/Controls.SelectBox.render.phpt
+++ b/tests/Forms/Controls.SelectBox.render.phpt
@@ -28,11 +28,11 @@ test(function () {
0 => 'Second',
]);
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.TextArea.render.phpt b/tests/Forms/Controls.TextArea.render.phpt
index 1b53abe8f..c510d0cdf 100644
--- a/tests/Forms/Controls.TextArea.render.phpt
+++ b/tests/Forms/Controls.TextArea.render.phpt
@@ -27,11 +27,11 @@ test(function () {
->setValue('&text')
->setAttribute('autocomplete', 'off');
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.TextBase.loadData.phpt b/tests/Forms/Controls.TextBase.loadData.phpt
index 3e0a25b86..9ae736427 100644
--- a/tests/Forms/Controls.TextBase.loadData.phpt
+++ b/tests/Forms/Controls.TextBase.loadData.phpt
@@ -98,7 +98,7 @@ test(function () { // setValue() and invalid argument
Assert::exception(function () use ($input) {
$input->setValue([]);
- }, 'Nette\InvalidArgumentException', "Value must be scalar or NULL, array given in field 'text'.");
+ }, Nette\InvalidArgumentException::class, "Value must be scalar or NULL, array given in field 'text'.");
});
diff --git a/tests/Forms/Controls.TextInput.render.phpt b/tests/Forms/Controls.TextInput.render.phpt
index d01ab6072..fd521df4b 100644
--- a/tests/Forms/Controls.TextInput.render.phpt
+++ b/tests/Forms/Controls.TextInput.render.phpt
@@ -27,11 +27,11 @@ test(function () {
->setValue('text')
->setAttribute('autocomplete', 'off');
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Controls.UploadControl.render.phpt b/tests/Forms/Controls.UploadControl.render.phpt
index 18a51e8d8..1f18ff536 100644
--- a/tests/Forms/Controls.UploadControl.render.phpt
+++ b/tests/Forms/Controls.UploadControl.render.phpt
@@ -25,11 +25,11 @@ test(function () {
$form = new Form;
$input = $form->addUpload('file', 'Label');
- Assert::type('Nette\Utils\Html', $input->getLabel());
+ Assert::type(Nette\Utils\Html::class, $input->getLabel());
Assert::same('', (string) $input->getLabel());
Assert::same('', (string) $input->getLabel('Another label'));
- Assert::type('Nette\Utils\Html', $input->getControl());
+ Assert::type(Nette\Utils\Html::class, $input->getControl());
Assert::same('', (string) $input->getControl());
});
diff --git a/tests/Forms/Helpers.createSelectBox.phpt b/tests/Forms/Helpers.createSelectBox.phpt
index 7d27fb4d6..c94e848ee 100644
--- a/tests/Forms/Helpers.createSelectBox.phpt
+++ b/tests/Forms/Helpers.createSelectBox.phpt
@@ -14,7 +14,7 @@ require __DIR__ . '/../bootstrap.php';
test(function () {
Assert::type(
- 'Nette\Utils\Html',
+ Nette\Utils\Html::class,
Helpers::createSelectBox([])
);