From ee9309b73b1b9e036b9e076b24f4bbd13db405e1 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sun, 7 Mar 2021 16:24:57 +0000 Subject: [PATCH 1/3] #2111 - Remove deprecated/removed function image2wbmp() --- prototypes/gd.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/prototypes/gd.php b/prototypes/gd.php index 39000ae9e6..ec7bc0236b 100644 --- a/prototypes/gd.php +++ b/prototypes/gd.php @@ -85,23 +85,6 @@ function image_type_to_mime_type($imagetype) } } -if (!function_exists('image2wbmp') && PHP_VERSION_ID < 70400) { - /** - * Output image to browser or file. - * - * @see https://www.php.net/manual/en/function.image2wbmp.php - * - * @param resource $image - * @param string $filename - * @param int $threshold - * - * @return bool - */ - function image2wbmp($image, $filename, $threshold) - { - } -} - if (!function_exists('imageaffine')) { /** * Return an image containing the affine transformed src image, using an optional clipping area. From 38a1c069573a8c5f174424f6d4e23990fad4d98a Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sun, 7 Mar 2021 16:47:36 +0000 Subject: [PATCH 2/3] #2111 - Review tests --- tests/Extension/ArithmeticTest.php | 37 +++--- tests/Extension/ArrayAccessTest.php | 18 +-- tests/Extension/ArrayIteratorTest.php | 16 +-- tests/Extension/ArrayObjectTest.php | 12 +- tests/Extension/ArraySearchTest.php | 17 +-- tests/Extension/AssignTest.php | 29 +++-- tests/Extension/BitwiseTest.php | 15 ++- tests/Extension/BranchPredictionTest.php | 12 +- tests/Extension/BuiltIn/CharMethodTest.php | 12 +- tests/Extension/BuiltIn/IntMethodTest.php | 19 +-- tests/Extension/BuiltIn/StringMethodTest.php | 11 +- tests/Extension/CastTest.php | 96 +++++++-------- tests/Extension/CblockTest.php | 15 ++- tests/Extension/CharsTest.php | 20 ++-- tests/Extension/ClosureTest.php | 15 ++- tests/Extension/CompareTest.php | 25 ++-- tests/Extension/ConcatTest.php | 25 ++-- tests/Extension/ConstantsInterfaceTest.php | 49 ++++---- tests/Extension/ConstantsTest.php | 32 ++--- tests/Extension/DeclareTest.php | 12 +- tests/Extension/DynamicPropTest.php | 15 ++- tests/Extension/EmptyTest.php | 12 +- tests/Extension/EvalTest.php | 12 +- tests/Extension/ExceptionsTest.php | 21 ++-- tests/Extension/ExistsTest.php | 12 +- tests/Extension/ExitDieTest.php | 19 +-- tests/Extension/ExtendedInterfaceTest.php | 20 ++-- tests/Extension/ExtensionInfoTest.php | 10 +- tests/Extension/FcallTest.php | 42 ++++--- tests/Extension/FetchTest.php | 24 ++-- tests/Extension/FibonnaciTest.php | 15 ++- tests/Extension/Flow/SwitchFlowTest.php | 12 +- tests/Extension/FlowTest.php | 24 ++-- tests/Extension/FunctionExistsTest.php | 21 ++-- tests/Extension/FunctionsTest.php | 8 +- tests/Extension/Globals/EnvTest.php | 16 +-- tests/Extension/Globals/PostTest.php | 16 +-- .../Globals/ServerRequestFactoryTest.php | 18 +-- tests/Extension/Globals/ServerTest.php | 16 +-- tests/Extension/Globals/SessionTest.php | 18 +-- tests/Extension/GlobalsTest.php | 29 ++--- tests/Extension/InstanceOffTest.php | 44 ++++--- tests/Extension/InstanceTest.php | 12 +- tests/Extension/Integral/FannkuchTest.php | 15 ++- tests/Extension/Integral/RegexDNATest.php | 15 ++- tests/Extension/Integral/SortTest.php | 15 ++- .../InterfaceMethodSignatureTest.php | 6 +- tests/Extension/InternalClassesTest.php | 14 ++- tests/Extension/InvokeTest.php | 15 ++- tests/Extension/IssetTest.php | 30 +++-- tests/Extension/Issue1521Test.php | 15 ++- tests/Extension/JsonTest.php | 20 ++-- tests/Extension/MCallDynamicTest.php | 16 +-- tests/Extension/MCallTest.php | 42 ++++--- tests/Extension/McallChainedTest.php | 22 ++-- tests/Extension/McallInternalTest.php | 17 ++- tests/Extension/MethodArgsTest.php | 20 ++-- tests/Extension/NativeArrayTest.php | 44 +++---- tests/Extension/NewInstanceOperatorTest.php | 26 ++-- tests/Extension/Oo/ExtendClassTest.php | 18 +-- tests/Extension/Oo/OoParamsStrictTest.php | 27 ++--- tests/Extension/Oo/OoParamsTest.php | 18 +-- .../Extension/Oo/Scopes/PrivateScopeTest.php | 113 +++++++----------- tests/Extension/OoTest.php | 33 ++--- tests/Extension/OperatorTest.php | 24 ++-- tests/Extension/Optimizers/ArrayMergeTest.php | 12 +- .../Extension/Optimizers/CreateArrayTest.php | 14 ++- .../Extension/Optimizers/IsPhpVersionTest.php | 61 +++++----- tests/Extension/Optimizers/IsScalarTest.php | 17 +-- tests/Extension/Optimizers/MathTest.php | 24 ++-- tests/Extension/Optimizers/StrReplaceTest.php | 16 +-- tests/Extension/Optimizers/SubstrTest.php | 14 ++- tests/Extension/PregmatchTest.php | 62 ++-------- .../Properties/PrivatePropertiesTest.php | 8 +- .../Properties/PropertyArrayTest.php | 14 ++- .../Properties/PropertyUpdateTest.php | 10 +- .../Properties/ProtectedPropertiesTest.php | 14 ++- .../Properties/PublicPropertiesTest.php | 18 +-- .../StaticPrivatePropertiesTest.php | 12 +- .../Properties/StaticPropertyArrayTest.php | 12 +- .../Properties/StaticPublicPropertiesTest.php | 67 ++++++----- tests/Extension/RequiresTest.php | 17 +-- tests/Extension/ResourceTest.php | 13 +- tests/Extension/ReturnsTest.php | 18 +-- tests/Extension/RouterTest.php | 18 +-- tests/Extension/SPropertyAccessTest.php | 26 ++-- tests/Extension/ScallExternalTest.php | 19 +-- tests/Extension/ScallLateConstructTest.php | 18 ++- tests/Extension/ScallTest.php | 24 ++-- tests/Extension/ScopeTest.php | 18 ++- tests/Extension/StatementsTest.php | 21 ++-- tests/Extension/StringTest.php | 86 +++++++------ tests/Extension/TernaryTest.php | 19 +-- tests/Extension/TryTest.php | 14 ++- tests/Extension/TypeHinting/AbstractTest.php | 16 +-- tests/Extension/TypeoffTest.php | 32 ++--- tests/Extension/UnsetTest.php | 23 ++-- tests/Extension/VarsTest.php | 87 +++++++------- tests/Zephir/AliasManagerTest.php | 31 +++-- .../Backends/ZendEngine3/BackendTest.php | 13 +- .../CompilerFile/CheckDependenciesTest.php | 12 +- .../CompilerFile/CheckPathSeparatorTest.php | 13 +- tests/Zephir/ConfigExceptionTest.php | 12 +- tests/Zephir/ConfigTest.php | 36 ++++-- tests/Zephir/Detectors/ReadDetectorTest.php | 12 +- .../Documentation/Annotation/LinkTest.php | 18 +-- .../Annotation/ReturnAnnotationTest.php | 20 ++-- .../Documentation/Annotation/SeeTest.php | 18 +-- tests/Zephir/Documentation/AnnotationTest.php | 12 +- .../Documentation/DocblockParserTest.php | 12 +- tests/Zephir/Documentation/DocblockTest.php | 14 ++- .../FunctionLike/ReturnType/CastHintTest.php | 18 +-- .../ReturnType/CollectionTest.php | 63 +++++----- .../FunctionLike/ReturnType/FactoryTest.php | 17 +-- .../FunctionLike/ReturnType/RealTypeTest.php | 18 +-- tests/Zephir/HelpersTest.php | 19 +-- tests/Zephir/KernelTestCase.php | 12 +- .../Formatter/CompilerFormatterTest.php | 21 ++-- .../FunctionCall/PregMatchOptimizerTest.php | 21 ++-- tests/Zephir/Statements/Let/VariableTest.php | 27 ++--- tests/Zephir/Stubs/DocBlockTest.php | 26 ++-- tests/Zephir/Stubs/GeneratorTest.php | 39 ++++-- tests/Zephir/Stubs/MethodDocBlockTest.php | 25 ++-- tests/Zephir/TypesTest.php | 35 ++++-- tests/Zephir/VariableTest.php | 17 +-- 125 files changed, 1549 insertions(+), 1364 deletions(-) diff --git a/tests/Extension/ArithmeticTest.php b/tests/Extension/ArithmeticTest.php index 423432bca8..cc504d6bbf 100644 --- a/tests/Extension/ArithmeticTest.php +++ b/tests/Extension/ArithmeticTest.php @@ -1,35 +1,38 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Arithmetic; -class ArithmeticTest extends TestCase +final class ArithmeticTest extends TestCase { - protected $class; + protected Arithmetic $class; protected function setUp(): void { - $this->class = new \Stub\Arithmetic(); + $this->class = new Arithmetic(); } - public function testIntSum() + public function testIntSum(): void { $this->assertSame($this->class->intSum(), 3); $this->assertSame($this->class->int2Sum(), 3); $this->assertSame($this->class->intSumSimple(), 3); } - public function testDoubleSum() + public function testDoubleSum(): void { $this->assertSame($this->class->doubleSum(), 3.0); $this->assertSame($this->class->double2Sum(), 3.0); @@ -37,7 +40,7 @@ public function testDoubleSum() $this->assertSame($this->class->doubleSum2Simple(), 3.0); } - public function testSummTest() + public function testSummTest(): void { $this->assertSame($this->class->varSum(), 3); $this->assertSame($this->class->varSumSimple(), 3); @@ -74,7 +77,7 @@ public function testSummTest() $this->assertSame($this->class->complex24Sum(), 3.0); } - public function testBoolSum() + public function testBoolSum(): void { $this->assertTrue($this->class->boolSum()); $this->assertTrue($this->class->bool2Sum()); @@ -82,7 +85,7 @@ public function testBoolSum() $this->assertTrue($this->class->boolSumSimple()); } - public function testVarLess() + public function testVarLess(): void { $this->assertTrue($this->class->less1()); $this->assertFalse($this->class->less2()); @@ -104,7 +107,7 @@ public function testVarLess() $this->assertTrue($this->class->less4(4)); } - public function testVarGreater() + public function testVarGreater(): void { $this->assertFalse($this->class->greater1()); $this->assertTrue($this->class->greater2()); @@ -126,7 +129,7 @@ public function testVarGreater() $this->assertFalse($this->class->greater4(4)); } - public function testAddSum() + public function testAddSum(): void { $this->assertSame($this->class->addSum1(), 10); $this->assertSame($this->class->addSum2(), 0); @@ -159,7 +162,7 @@ public function testAddSum() $this->assertSame($this->class->addSum24(1), 1 + (1 << 10)); } - public function testSubTest() + public function testSubTest(): void { $this->assertSame($this->class->intSub(), -1); $this->assertSame($this->class->intSub2(), -1); @@ -235,20 +238,20 @@ public function testSubTest() $this->assertSame($this->class->sub24(1), 1 - (1 << 10)); } - public function testMul() + public function testMul(): void { $this->assertSame($this->class->mul1(), 5); $this->assertSame($this->class->mul2(5), 25); $this->assertSame($this->class->mul3(), 1 * (1 << 10)); } - public function testDiv() + public function testDiv(): void { $this->assertSame(24.75, $this->class->div1()); $this->assertSame(24.75, $this->class->div2()); } - public function testLetStatement() + public function testLetStatement(): void { $this->assertSame($this->class->letStatementIntMinus(), -1); $this->assertSame($this->class->letStatementVarMinus(1), -1); diff --git a/tests/Extension/ArrayAccessTest.php b/tests/Extension/ArrayAccessTest.php index 000654e464..e350920045 100644 --- a/tests/Extension/ArrayAccessTest.php +++ b/tests/Extension/ArrayAccessTest.php @@ -1,25 +1,27 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class ArrayAccessTest extends TestCase +final class ArrayAccessTest extends TestCase { - public function testTest() + public function testTest(): void { - $arrtest = new \Stub\ArrayAccessTest(); + $class = new \Stub\ArrayAccessTest(); - $this->assertTrue($arrtest->exits('one')); - $this->assertSame(2, $arrtest->get()); + $this->assertTrue($class->exits('one')); + $this->assertSame(2, $class->get()); } } diff --git a/tests/Extension/ArrayIteratorTest.php b/tests/Extension/ArrayIteratorTest.php index fe13708bce..1a1a669745 100644 --- a/tests/Extension/ArrayIteratorTest.php +++ b/tests/Extension/ArrayIteratorTest.php @@ -1,24 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class ArrayIteratorTest extends TestCase +final class ArrayIteratorTest extends TestCase { - public function testTest() + public function testTest(): void { - $itertest = new \Stub\ArrayIteratorTest(); + $class = new \Stub\ArrayIteratorTest(); - $this->assertTrue(!empty($itertest->test())); + $this->assertTrue(!empty($class->test())); } } diff --git a/tests/Extension/ArrayObjectTest.php b/tests/Extension/ArrayObjectTest.php index 2e45f75c4a..c5dc6d3e4f 100644 --- a/tests/Extension/ArrayObjectTest.php +++ b/tests/Extension/ArrayObjectTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\ArrayObject; -class ArrayObjectTest extends TestCase +final class ArrayObjectTest extends TestCase { - public function testSetGet() + public function testSetGet(): void { $test = new ArrayObject(); $this->assertInstanceOf('\ArrayObject', $test); diff --git a/tests/Extension/ArraySearchTest.php b/tests/Extension/ArraySearchTest.php index 1006b82e17..44139148f0 100644 --- a/tests/Extension/ArraySearchTest.php +++ b/tests/Extension/ArraySearchTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,10 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\ArraySearch; -class ArraySearchTest extends TestCase +final class ArraySearchTest extends TestCase { - /** @var ArraySearch */ - private $test; + private ArraySearch $test; protected function setUp(): void { @@ -27,7 +28,7 @@ protected function setUp(): void /** * @issue https://github.com/phalcon/zephir/issues/1609 */ - public function testShouldSearchInTheExternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey() + public function testShouldSearchInTheExternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey(): void { $needle = 'value'; $haystack = ['.', '/', '0', '1', '2', '3', '4', 'value', 'OtherValue']; @@ -38,7 +39,7 @@ public function testShouldSearchInTheExternalArrayForAGivenValueAndReturnTheFirs /** * @issue https://github.com/phalcon/zephir/issues/1609 */ - public function testShouldSearchInTheInternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey() + public function testShouldSearchInTheInternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey(): void { $this->assertEquals(7, $this->test->searchUsingArrayInsideZephir()); } diff --git a/tests/Extension/AssignTest.php b/tests/Extension/AssignTest.php index b7b74eefb2..3750b4b0eb 100644 --- a/tests/Extension/AssignTest.php +++ b/tests/Extension/AssignTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,10 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Assign; -class AssignTest extends TestCase +final class AssignTest extends TestCase { - /** @var Assign */ - private $test; + private Assign $test; protected function setUp(): void { @@ -31,12 +32,12 @@ protected function setUp(): void * @param string $test * @param mixed $testParams */ - public function testShouldPerformAssignment($expected, $test, $testParams = null) + public function testShouldPerformAssignment($expected, $test, $testParams = null): void { $this->assertSame($expected, \call_user_func([$this->test, $test], $testParams)); } - public function variableAssignProvider() + public function variableAssignProvider(): array { $arry = [ 'a' => [ @@ -102,7 +103,7 @@ public function variableAssignProvider() * @param string $test * @param mixed $testParams */ - public function testShouldPerformAssignmentForProperties($expected, $test, $testParams = null) + public function testShouldPerformAssignmentForProperties($expected, $test, $testParams = null): void { if ('array' === \gettype($testParams)) { $this->assertSame($expected, \call_user_func_array([$this->test, $test], $testParams)); @@ -111,7 +112,7 @@ public function testShouldPerformAssignmentForProperties($expected, $test, $test } } - public function propertyAssignProvider() + public function propertyAssignProvider(): array { $arry = [ 'a' => [ @@ -142,7 +143,7 @@ public function propertyAssignProvider() ]; } - public function testGlobalVarAssign() + public function testGlobalVarAssign(): void { /* * @see LetStatement::_assignArrayIndexSingle(); @@ -160,19 +161,17 @@ public function testGlobalVarAssign() $this->assertSame($_GET['stest2'], 'testval'); } - public function testGlobalVarAssignSERVER() + public function testGlobalVarAssignSERVER(): void { $serverCount = \count($_SERVER); - $this->test->testAssignSuperGlobalsSERVER(); $this->assertCount($serverCount + 2, $_SERVER); } - public function testGlobalVarAssignGET() + public function testGlobalVarAssignGET(): void { $getCount = \count($_GET); - $this->test->testAssignSuperGlobalsGET(); $this->assertCount($getCount + 2, $_GET); diff --git a/tests/Extension/BitwiseTest.php b/tests/Extension/BitwiseTest.php index 656102825e..d9e553a1c0 100644 --- a/tests/Extension/BitwiseTest.php +++ b/tests/Extension/BitwiseTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Bitwise; -class BitwiseTest extends TestCase +final class BitwiseTest extends TestCase { public function testBitwise() { - $test = new \Stub\Bitwise(); + $test = new Bitwise(); // OR TESTS $this->assertSame($test->intAnd(), 0); @@ -123,7 +126,7 @@ public function testBitwise() $this->assertSame($test->testBitwiseNot(666), -667); $this->assertSame($test->testBitwiseAndNot(5, 4), 1); - /* + /** * Bitwise XOR * @issue https://github.com/phalcon/zephir/issues/1581 */ diff --git a/tests/Extension/BranchPredictionTest.php b/tests/Extension/BranchPredictionTest.php index 4d5f0da4af..d9196a9ee1 100644 --- a/tests/Extension/BranchPredictionTest.php +++ b/tests/Extension/BranchPredictionTest.php @@ -1,21 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class BranchPredictionTest extends TestCase +final class BranchPredictionTest extends TestCase { - public function testVariants() + public function testVariants(): void { $br = new \Stub\BranchPrediction(); diff --git a/tests/Extension/BuiltIn/CharMethodTest.php b/tests/Extension/BuiltIn/CharMethodTest.php index 7b942d8c3c..ea44123a17 100644 --- a/tests/Extension/BuiltIn/CharMethodTest.php +++ b/tests/Extension/BuiltIn/CharMethodTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\BuiltIn; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\BuiltIn\CharMethods; -class CharMethodTest extends TestCase +final class CharMethodTest extends TestCase { - public function testModifications() + public function testModifications(): void { $charm = new CharMethods(); diff --git a/tests/Extension/BuiltIn/IntMethodTest.php b/tests/Extension/BuiltIn/IntMethodTest.php index 2af22fc4c6..013c900d89 100644 --- a/tests/Extension/BuiltIn/IntMethodTest.php +++ b/tests/Extension/BuiltIn/IntMethodTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\BuiltIn; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\BuiltIn\IntMethods; -class IntMethodTest extends TestCase +final class IntMethodTest extends TestCase { - /** @var IntMethods */ - private $test; + private IntMethods $test; protected function setUp(): void { $this->test = new IntMethods(); } - public function testMath() + public function testMath(): void { $this->assertSame(abs(10), $this->test->getAbs(10)); $this->assertSame(abs(-5), $this->test->getAbs1()); @@ -36,7 +37,7 @@ public function testMath() $this->assertSame(log(10, 10), $this->test->getLog(10, 10)); } - public function testTrigonometry() + public function testTrigonometry(): void { $this->assertSame(sin(1), $this->test->getSin(1)); $this->assertSame(cos(1), $this->test->getCos(1)); @@ -46,7 +47,7 @@ public function testTrigonometry() $this->assertSame(atan(1), $this->test->getAtan(1)); } - public function testTransforms() + public function testTransforms(): void { $this->assertSame(decbin(255), $this->test->getBinary(255)); $this->assertSame(dechex(255), $this->test->getHex(255)); diff --git a/tests/Extension/BuiltIn/StringMethodTest.php b/tests/Extension/BuiltIn/StringMethodTest.php index d282ed84e0..809a22e689 100644 --- a/tests/Extension/BuiltIn/StringMethodTest.php +++ b/tests/Extension/BuiltIn/StringMethodTest.php @@ -1,21 +1,22 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\BuiltIn; -use PHPUnit\Framework\Error\Warning; use PHPUnit\Framework\TestCase; use Stub\BuiltIn\StringMethods; -class StringMethodTest extends TestCase +final class StringMethodTest extends TestCase { private ?StringMethods $test = null; diff --git a/tests/Extension/CastTest.php b/tests/Extension/CastTest.php index f97bf5eea7..b7e97f0724 100644 --- a/tests/Extension/CastTest.php +++ b/tests/Extension/CastTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,12 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Cast; -class CastTest extends TestCase +final class CastTest extends TestCase { - /** - * @var Cast - */ - private $test; + private ?Cast $test = null; protected function setUp(): void { @@ -34,44 +33,40 @@ protected function tearDown(): void /** * @see https://github.com/phalcon/zephir/issues/1988 */ - public function testCharCast() + public function testCharCast(): void { - /* + /** * Value */ - $this->assertSame(97, $this->test->testCharCastFromChar()); - /* + /** * Variable types */ - $this->assertSame(65, $this->test->testCharCastFromVariableChar()); } - public function testStringCast() + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ + public function testStringCast(): void { - /* + /** * Value */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame('z', $this->test->testStringCastChar()); - /* + /** * Variable types */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame('X', $this->test->testStringCastVariableChar()); } - public function testIntCast() + public function testIntCast(): void { - /* + /** * Value */ - $this->assertSame(5, $this->test->testIntCastFromFloat()); $this->assertSame(1, $this->test->testIntCastFromBooleanTrue()); $this->assertSame(0, $this->test->testIntCastFromBooleanFalse()); @@ -82,16 +77,17 @@ public function testIntCast() $this->assertSame(1, $this->test->testIntCastFromStdClass()); $this->assertSame(65, $this->test->testIntCastFromChar()); - /* + /** * Variable types */ - $this->assertSame(5, $this->test->testIntCastFromVariableFloat()); $this->assertSame(1, $this->test->testIntCastFromVariableBooleanTrue()); $this->assertSame(0, $this->test->testIntCastFromVariableBooleanFalse()); $this->assertSame(0, $this->test->testIntCastFromVariableNull()); - // https://github.com/phalcon/zephir/issues/1988 + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ $this->assertSame(97, $this->test->testIntCastFromVariableChar()); $this->assertSame(0, $this->test->testIntCastFromVariableString()); @@ -106,24 +102,23 @@ public function testIntCast() $this->assertSame(1, $this->test->testIntCastFromVariableStdClass()); } - public function testLongCast() + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ + public function testLongCast(): void { - /* + /** * Value */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame(97, $this->test->testLongCastFromChar()); - /* + /** * Variable types */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame(65, $this->test->testLongCastFromVariableChar()); } - public function testFloatCast() + public function testFloatCast(): void { $this->assertSame(5.0, $this->test->testFloatCastFromFloat()); $this->assertSame(1.0, $this->test->testFloatCastFromBooleanTrue()); @@ -142,50 +137,51 @@ public function testFloatCast() $this->assertSame(1.0, $this->test->testFloatCastFromVariableStdClass()); } - public function testDoubleCast() + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ + public function testDoubleCast(): void { - /* + /** * Value */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame(97.0, $this->test->testDoubleCastFromVChar()); - /* + /** * Variable types */ - - // https://github.com/phalcon/zephir/issues/1988 $this->assertSame(65.0, $this->test->testDoubleCastFromVariableChar()); } - public function testBooleanCast() + public function testBooleanCast(): void { - /* + /** * Value */ - $this->assertTrue($this->test->testBooleanCastFromIntTrue1()); $this->assertTrue($this->test->testBooleanCastFromIntTrue2()); $this->assertFalse($this->test->testBooleanCastFromIntFalse()); - // https://github.com/phalcon/zephir/issues/1988 + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ $this->assertTrue($this->test->testBooleanCastFromChar()); - /* + /** * Variable types */ - $this->assertTrue($this->test->testBooleanCastFromObject()); $this->assertFalse($this->test->testBooleanCastFromEmptyArray()); $this->assertTrue($this->test->testBooleanCastFromArray()); $this->assertFalse($this->test->testBooleanCastFromNull()); - // https://github.com/phalcon/zephir/issues/1988 + /** + * @issue https://github.com/phalcon/zephir/issues/1988 + */ $this->assertTrue($this->test->testBooleanCastFromVariableChar()); } - public function testObjectCast() + public function testObjectCast(): void { $this->assertEquals((object) 5, $this->test->testObjectCastFromInt()); $this->assertEquals((object) 5.0, $this->test->testObjectCastFromFloat()); @@ -198,7 +194,7 @@ public function testObjectCast() $this->assertEquals((object) 'test string', $this->test->testObjectCastFromString()); } - public function testArrayCast() + public function testArrayCast(): void { $this->assertEquals((array) [1, 2, 3], $this->test->testArrayCastFromVariableArray()); $this->assertEquals((array) true, $this->test->testArrayCastFromVariableTrue()); diff --git a/tests/Extension/CblockTest.php b/tests/Extension/CblockTest.php index 73a9b4d3da..8dc60ef1fd 100644 --- a/tests/Extension/CblockTest.php +++ b/tests/Extension/CblockTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Cblock; -class CblockTest extends TestCase +final class CblockTest extends TestCase { - public function testBlock() + public function testBlock(): void { - $test = new \Stub\Cblock(); + $test = new Cblock(); $this->assertSame($test->testCblock1(), 10); $this->assertSame($test->testCblock2(), 55); } diff --git a/tests/Extension/CharsTest.php b/tests/Extension/CharsTest.php index 93b06897a3..8886e0374f 100644 --- a/tests/Extension/CharsTest.php +++ b/tests/Extension/CharsTest.php @@ -1,35 +1,37 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Chars; -class CharsTest extends TestCase +final class CharsTest extends TestCase { - /** @var \Stub\Chars */ - private $test; + private Chars $test; protected function setUp(): void { - $this->test = new \Stub\Chars(); + $this->test = new Chars(); } - public function testSumChars() + public function testSumChars(): void { $this->assertSame(\chr($this->test->sumChars1()), 'a'); $this->assertSame(\chr($this->test->sumChars2('A')), 'a'); } - public function testDiffChars() + public function testDiffChars(): void { $this->assertSame(\chr($this->test->diffChars1()), 'A'); $this->assertSame(\chr($this->test->diffChars2('a')), 'A'); diff --git a/tests/Extension/ClosureTest.php b/tests/Extension/ClosureTest.php index 6f423a9907..ebe5636014 100644 --- a/tests/Extension/ClosureTest.php +++ b/tests/Extension/ClosureTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Closures; -class ClosureTest extends TestCase +final class ClosureTest extends TestCase { - public function testUseCommand() + public function testUseCommand(): void { - $test = new \Stub\Closures(); + $test = new Closures(); $this->assertSame(2, $test->testUseCommand()()); } diff --git a/tests/Extension/CompareTest.php b/tests/Extension/CompareTest.php index c8da7187f1..d6c4edfe4a 100644 --- a/tests/Extension/CompareTest.php +++ b/tests/Extension/CompareTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,37 +16,36 @@ use PHPUnit\Framework\TestCase; use Stub\Compare; -class CompareTest extends TestCase +final class CompareTest extends TestCase { - /** @var Compare */ - private $test; + private Compare $test; protected function setUp(): void { $this->test = new Compare(); } - public function testLess() + public function testLess(): void { $this->assertTrue($this->test->isLessInt(1, 2)); $this->assertTrue($this->test->isLessDouble(1.1, 1.2)); $this->assertFalse($this->test->isLessInt(20, 10)); } - public function testGreaterEqual() + public function testGreaterEqual(): void { $this->assertTrue($this->test->isGreaterEqual(3, 2)); $this->assertTrue($this->test->isGreaterEqual(2, 2)); $this->assertFalse($this->test->isGreaterEqual(1, 2)); } - public function testConst() + public function testConst(): void { $this->assertTrue($this->test->isLessThenPi(3.12)); $this->assertTrue($this->test->isMoreThenPi(3.15)); } - public function testVarWithStringEquals() + public function testVarWithStringEquals(): void { $this->assertSame('NOK', $this->test->testVarWithStringEquals('wrong testing')); $this->assertSame('NOK', $this->test->testVarWithStringEquals('another testing')); @@ -52,7 +53,7 @@ public function testVarWithStringEquals() $this->assertSame('NOK', $this->test->testVarWithStringEquals('testing nok')); } - public function testEquals() + public function testEquals(): void { $this->assertTrue($this->test->testVarEqualsNull(null)); $this->assertFalse($this->test->testVarEqualsNull(1)); @@ -61,7 +62,7 @@ public function testEquals() $this->assertFalse($this->test->testNullEqualsVar(1)); } - public function testNotEquals() + public function testNotEquals(): void { $this->assertTrue($this->test->testNotIdenticalZeroVar()); $this->assertTrue($this->test->testNotIdenticalZeroInt()); diff --git a/tests/Extension/ConcatTest.php b/tests/Extension/ConcatTest.php index 947951e538..ebd69a8350 100644 --- a/tests/Extension/ConcatTest.php +++ b/tests/Extension/ConcatTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\Concat; -class ConcatTest extends TestCase +final class ConcatTest extends TestCase { - /** @var Concat */ - private $test; + private Concat $test; protected function setUp(): void { $this->test = new Concat(); } - public function testShouldConcatenateLocalVariableAndSelfVariable() + public function testShouldConcatenateLocalVariableAndSelfVariable(): void { $this->assertNull($this->test->getTestProperty()); @@ -35,12 +36,12 @@ public function testShouldConcatenateLocalVariableAndSelfVariable() $this->assertSame('test string', $this->test->getTestProperty()); } - public function testShouldAppendVariableToString() + public function testShouldAppendVariableToString(): void { $this->assertSame('appendtest', $this->test->testConcat1()); } - public function testShouldConcatenateVariableWithString() + public function testShouldConcatenateVariableWithString(): void { $this->assertSame('appendotherappendother', $this->test->testConcat2()); } @@ -48,7 +49,7 @@ public function testShouldConcatenateVariableWithString() /** * @issue https://github.com/phalcon/zephir/issues/1573 */ - public function testShouldConcatenateStringsSimilarToIntegersNumbers() + public function testShouldConcatenateStringsSimilarToIntegersNumbers(): void { $this->assertSame('21', $this->test->testConcat3()); } @@ -56,7 +57,7 @@ public function testShouldConcatenateStringsSimilarToIntegersNumbers() /** * @issue https://github.com/phalcon/zephir/issues/1893 */ - public function testShouldConcatenateStringWithVarDouble() + public function testShouldConcatenateStringWithVarDouble(): void { $this->assertSame( 'SELECT * FROM TEST WHERE value <= 946.5 AND value >= 473.25', @@ -67,7 +68,7 @@ public function testShouldConcatenateStringWithVarDouble() /** * @issue https://github.com/phalcon/zephir/issues/1893 */ - public function testShouldConcatenateStringWithDouble() + public function testShouldConcatenateStringWithDouble(): void { $this->assertSame( 'Concatenated string with number 18.93000001', diff --git a/tests/Extension/ConstantsInterfaceTest.php b/tests/Extension/ConstantsInterfaceTest.php index 542ca4cc87..2d169a5485 100644 --- a/tests/Extension/ConstantsInterfaceTest.php +++ b/tests/Extension/ConstantsInterfaceTest.php @@ -1,39 +1,42 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\ConstantsInterface; +use Stub\TestInterface; -class ConstantsInterfaceTest extends TestCase +final class ConstantsInterfaceTest extends TestCase { - /** @var \Stub\ConstantsInterface */ - private $test; + private ConstantsInterface $test; protected function setUp(): void { - $this->test = new \Stub\ConstantsInterface(); + $this->test = new ConstantsInterface(); } - public function testConstants() + public function testConstants(): void { - $this->assertSame(\Stub\TestInterface::C1, null); - $this->assertSame(\Stub\TestInterface::C2, false); - $this->assertSame(\Stub\TestInterface::C3, true); - $this->assertSame(\Stub\TestInterface::C4, 10); - $this->assertSame(\Stub\TestInterface::C5, 10.25); - $this->assertSame(\Stub\TestInterface::C6, 'test'); + $this->assertSame(TestInterface::C1, null); + $this->assertSame(TestInterface::C2, false); + $this->assertSame(TestInterface::C3, true); + $this->assertSame(TestInterface::C4, 10); + $this->assertSame(TestInterface::C5, 10.25); + $this->assertSame(TestInterface::C6, 'test'); } - public function testClassOfInterface() + public function testClassOfInterface(): void { $this->assertIsObject($this->test); $this->assertSame($this->test->testReadInterfaceConstant1(), null); @@ -44,17 +47,17 @@ public function testClassOfInterface() $this->assertSame($this->test->testReadInterfaceConstant6(), 'test'); } - public function testStaticConstantsInheritanceFromInterface() + public function testStaticConstantsInheritanceFromInterface(): void { - $this->assertSame(\Stub\ConstantsInterface::C1, null); - $this->assertSame(\Stub\ConstantsInterface::C2, false); - $this->assertSame(\Stub\ConstantsInterface::C3, true); - $this->assertSame(\Stub\ConstantsInterface::C4, 10); - $this->assertSame(\Stub\ConstantsInterface::C5, 10.25); - $this->assertSame(\Stub\ConstantsInterface::C6, 'test'); + $this->assertSame(ConstantsInterface::C1, null); + $this->assertSame(ConstantsInterface::C2, false); + $this->assertSame(ConstantsInterface::C3, true); + $this->assertSame(ConstantsInterface::C4, 10); + $this->assertSame(ConstantsInterface::C5, 10.25); + $this->assertSame(ConstantsInterface::C6, 'test'); } - public function testInstanceConstantsInheritanceFromInterface() + public function testInstanceConstantsInheritanceFromInterface(): void { $this->assertIsObject($this->test); $this->assertSame($this->test->testReadInheritanceFromInterfaceConstant1(), null); diff --git a/tests/Extension/ConstantsTest.php b/tests/Extension/ConstantsTest.php index cdf2180b44..f460b60993 100644 --- a/tests/Extension/ConstantsTest.php +++ b/tests/Extension/ConstantsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -15,12 +17,12 @@ use Stub\Constants; use Stub\Oo\ConstantsInterface; -class ConstantsTest extends TestCase +final class ConstantsTest extends TestCase { const EXPECTED_DOUBLE_DELIMITER = '.'; const EXPECTED_CONST_VARS = '$SOME/CSRF/KEY$'; - protected $test; + protected ?Constants $test = null; protected function setUp(): void { @@ -32,7 +34,7 @@ protected function tearDown(): void $this->test = null; } - public function testConstantsDeclaration() + public function testConstantsDeclaration(): void { $this->assertNull(Constants::C1); $this->assertFalse(Constants::C2); @@ -44,7 +46,7 @@ public function testConstantsDeclaration() $this->assertSame(Constants::STD_PROP_LIST, \ArrayObject::STD_PROP_LIST); } - public function testConstantGetters() + public function testConstantGetters(): void { $this->assertNull($this->test->getPropertyC1()); $this->assertFalse($this->test->getPropertyC2()); @@ -55,7 +57,7 @@ public function testConstantGetters() $this->assertSame($this->test->getPropertyC9(), 'some-value'); } - public function testConstantsRead() + public function testConstantsRead(): void { $this->assertSame($this->test->testReadConstant(), ENT_QUOTES); $this->assertSame($this->test->testReadClassConstant1(), Constants::C4); @@ -63,7 +65,7 @@ public function testConstantsRead() $this->assertSame($this->test->testReadClassConstant3(), \Stub\ConstantsParent::P4); } - public function testEnvConstants() + public function testEnvConstants(): void { $phpVersion = $this->test->testPHPVersionEnvConstant(); $this->assertTrue(\is_string($phpVersion) && !empty($phpVersion)); @@ -72,7 +74,7 @@ public function testEnvConstants() $this->assertTrue(\is_string($phpVersion) && !empty($phpVersion)); } - public function testMagickConstants() + public function testMagickConstants(): void { $this->assertSame($this->test->testNamespaceMagicConstant(), 'Stub'); $this->assertSame($this->test->testClassMagicConstant(), 'Stub\Constants'); @@ -90,24 +92,24 @@ public function testMagickConstants() * @author Alexnder Andriiako * * @since 2017-08-09 - * @see https://github.com/phalcon/zephir/issues/1571 + * @issue https://github.com/phalcon/zephir/issues/1571 */ - public function testStringDelimiterAsConstDoubleQuoted() + public function testStringDelimiterAsConstDoubleQuoted(): void { $this->assertSame($this->test->testStringDelimiterConstantDoubleQuoted(), self::EXPECTED_DOUBLE_DELIMITER); } - public function testStringConstWithPhpVars() + public function testStringConstWithPhpVars(): void { $this->assertSame($this->test->testStringConstantWithVars(), self::EXPECTED_CONST_VARS); } - public function testStringConstWithPhpVarsAssigned() + public function testStringConstWithPhpVarsAssigned(): void { $this->assertSame($this->test->testStringPropertyWithVarsAssigned(), self::EXPECTED_CONST_VARS); } - public function testStringConstWithPhpVarsGet() + public function testStringConstWithPhpVarsGet(): void { $this->assertSame($this->test->testStringPropertyWithVarsGet(), self::EXPECTED_CONST_VARS); } diff --git a/tests/Extension/DeclareTest.php b/tests/Extension/DeclareTest.php index 5ff208953f..78a5a15bfe 100644 --- a/tests/Extension/DeclareTest.php +++ b/tests/Extension/DeclareTest.php @@ -1,21 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class DeclareTest extends TestCase +final class DeclareTest extends TestCase { - public function testDeclareMcallExpression() + public function testDeclareMcallExpression(): void { $test = new \Stub\DeclareTest(); $this->assertSame($test->testDeclareMcallExpression(), 'hello'); diff --git a/tests/Extension/DynamicPropTest.php b/tests/Extension/DynamicPropTest.php index e665a669dc..f30372a8be 100644 --- a/tests/Extension/DynamicPropTest.php +++ b/tests/Extension/DynamicPropTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Oo\DynamicProp; -class DynamicPropTest extends TestCase +final class DynamicPropTest extends TestCase { - public function testSetProperty() + public function testSetProperty(): void { - $class = new \Stub\Oo\DynamicProp(); + $class = new DynamicProp(); $this->assertNull($class->test); $class->setPropertyInt('test'); diff --git a/tests/Extension/EmptyTest.php b/tests/Extension/EmptyTest.php index d07dd57856..3ccb6fefc2 100644 --- a/tests/Extension/EmptyTest.php +++ b/tests/Extension/EmptyTest.php @@ -1,21 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class EmptyTest extends TestCase +final class EmptyTest extends TestCase { - public function testEmpty() + public function testEmpty(): void { $test = new \Stub\EmptyTest(); diff --git a/tests/Extension/EvalTest.php b/tests/Extension/EvalTest.php index 04881abf91..27c82ed023 100644 --- a/tests/Extension/EvalTest.php +++ b/tests/Extension/EvalTest.php @@ -1,21 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class EvalTest extends TestCase +final class EvalTest extends TestCase { - public function testEval() + public function testEval(): void { $test = new \Stub\EvalTest(); diff --git a/tests/Extension/ExceptionsTest.php b/tests/Extension/ExceptionsTest.php index fb97ff7ee6..d992b3428d 100644 --- a/tests/Extension/ExceptionsTest.php +++ b/tests/Extension/ExceptionsTest.php @@ -1,12 +1,12 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -15,10 +15,9 @@ use Stub\Exception; use Stub\Exceptions; -class ExceptionsTest extends TestCase +final class ExceptionsTest extends TestCase { - /** @var Exceptions */ - private $test; + private Exceptions $test; protected function setUp(): void { @@ -27,7 +26,7 @@ protected function setUp(): void public function testException1(): void { - $this->expectException(\Stub\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('hello1'); $this->test->testException1(); @@ -35,7 +34,7 @@ public function testException1(): void public function testException2(): void { - $this->expectException(\Stub\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('hello2'); $this->test->testException2(); @@ -43,7 +42,7 @@ public function testException2(): void public function testException3(): void { - $this->expectException(\Stub\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('hello3'); $this->test->testException3(); @@ -51,7 +50,7 @@ public function testException3(): void public function testException4(): void { - $this->expectException(\Stub\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('hello4'); $this->test->testException4(); @@ -59,7 +58,7 @@ public function testException4(): void public function testException5(): void { - $this->expectException(\Stub\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('hello5'); $this->test->testException5(); diff --git a/tests/Extension/ExistsTest.php b/tests/Extension/ExistsTest.php index 22548ad68f..59306d8874 100644 --- a/tests/Extension/ExistsTest.php +++ b/tests/Extension/ExistsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Exists; -class ExistsTest extends TestCase +final class ExistsTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { $test = new Exists(); diff --git a/tests/Extension/ExitDieTest.php b/tests/Extension/ExitDieTest.php index f5813b5a23..5685121f4c 100644 --- a/tests/Extension/ExitDieTest.php +++ b/tests/Extension/ExitDieTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -15,8 +17,7 @@ class ExitDieTest extends TestCase { - /** @var string */ - private $phpBinary; + private string $phpBinary; /** * {@inheritdoc} @@ -39,7 +40,7 @@ protected function setUp(): void parent::setUp(); } - public function testShouldExitWthoutAnyMessage() + public function testShouldExitWthoutAnyMessage(): void { $testfile = __DIR__.'/../fixtures/exit.php'; $command = "$this->phpBinary $testfile"; @@ -60,7 +61,7 @@ public function testShouldExitWthoutAnyMessage() )); } - public function testShouldExitWthProvidedStatusMessage() + public function testShouldExitWthProvidedStatusMessage(): void { $testfile = __DIR__.'/../fixtures/exit_string.php'; $statusMessage = 'Hello World'; @@ -82,7 +83,7 @@ public function testShouldExitWthProvidedStatusMessage() )); } - public function testShouldExitWthProvidedStatusCode() + public function testShouldExitWthProvidedStatusCode(): void { $testfile = __DIR__.'/../fixtures/exit_int.php'; $statusCode = 220; @@ -104,7 +105,7 @@ public function testShouldExitWthProvidedStatusCode() )); } - private function prepareOutput($output) + private function prepareOutput(array $output): string { if (empty($output)) { return '(empty output)'; diff --git a/tests/Extension/ExtendedInterfaceTest.php b/tests/Extension/ExtendedInterfaceTest.php index c6affcd0a4..8678866047 100644 --- a/tests/Extension/ExtendedInterfaceTest.php +++ b/tests/Extension/ExtendedInterfaceTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,17 +16,11 @@ use PHPUnit\Framework\TestCase; use Stub\ExtendedInterface; -class ExtendedInterfaceTest extends TestCase +final class ExtendedInterfaceTest extends TestCase { - public function testShouldExtendsInterfaces() + public function testShouldExtendsInterfaces(): void { - try { - $reflection = new \ReflectionClass(ExtendedInterface::class); - } catch (\ReflectionException $e) { - $this->fail($e->getMessage()); - - return; - } + $reflection = new \ReflectionClass(ExtendedInterface::class); $this->assertTrue($reflection->isInterface()); $this->assertContains('IteratorAggregate', $reflection->getInterfaceNames()); diff --git a/tests/Extension/ExtensionInfoTest.php b/tests/Extension/ExtensionInfoTest.php index f50169c6eb..6d081f66ac 100644 --- a/tests/Extension/ExtensionInfoTest.php +++ b/tests/Extension/ExtensionInfoTest.php @@ -1,19 +1,21 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class ExtensionInfoTest extends TestCase +final class ExtensionInfoTest extends TestCase { /** * @see config.json for Directive keys diff --git a/tests/Extension/FcallTest.php b/tests/Extension/FcallTest.php index 25529512fd..96939b1bfc 100644 --- a/tests/Extension/FcallTest.php +++ b/tests/Extension/FcallTest.php @@ -1,6 +1,8 @@ @@ -15,24 +17,28 @@ use Stub\Fcall; use Stub\Oo\PropertyAccess; -class FcallTest extends TestCase +use function Stub\test_call_object_hint; +use function Stub\test_call_relative_object_hint; +use function Stub\zephir_namespaced_method_test; +use function Stub\zephir_namespaced_method_with_type_casting; + +final class FcallTest extends TestCase { - /** @var Fcall */ - private $test; + private Fcall $test; protected function setUp(): void { $this->test = new Fcall(); } - public function testCall() + public function testCall(): void { $this->assertSame(0, $this->test->testCall1()); $this->assertGreaterThan(-1, $this->test->testCall2()); $this->assertSame(2, $this->test->testCall1FromVar()); } - public function testStrtok() + public function testStrtok(): void { $this->assertFalse($this->test->testStrtokFalse()); $this->assertSame('test', $this->test->testStrtokVarBySlash('test')); @@ -44,7 +50,7 @@ public function testStrtok() * @param mixed $param1 * @param mixed $param2 */ - public function testFunctionGetArgs($param1, $param2) + public function testFunctionGetArgs($param1, $param2): void { $this->assertSame([$param1, $param2], $this->test->testFunctionGetArgs($param1, $param2)); } @@ -55,7 +61,7 @@ public function testFunctionGetArgs($param1, $param2) * @param mixed $param1 * @param mixed $param2 */ - public function testShouldGetArgsUsingAllExtraParams($param1, $param2) + public function testShouldGetArgsUsingAllExtraParams($param1, $param2): void { $this->assertSame([$param1, $param2], $this->test->testFunctionGetArgsAllExtra($param1, $param2)); } @@ -66,12 +72,12 @@ public function testShouldGetArgsUsingAllExtraParams($param1, $param2) * @param mixed $param1 * @param mixed $param2 */ - public function testShouldGetArgsUsingAllExtraParamsAndStaticFunction($param1, $param2) + public function testShouldGetArgsUsingAllExtraParamsAndStaticFunction($param1, $param2): void { $this->assertSame([$param1, $param2], Fcall::testStaticFunctionGetArgsAllExtra($param1, $param2)); } - public function getArgsDataProvider() + public function getArgsDataProvider(): array { return [ [true, false], @@ -84,17 +90,17 @@ public function getArgsDataProvider() ]; } - public function testShouldGedDesiredArgUsingAllExtraParams() + public function testShouldGedDesiredArgUsingAllExtraParams(): void { $this->assertSame([true, false], $this->test->testFunctionGetArgAllExtra(true, false)); } - public function testShouldGedDesiredArgUsingAllExtraParamsAndStaticFunction() + public function testShouldGedDesiredArgUsingAllExtraParamsAndStaticFunction(): void { $this->assertSame([true, false], Fcall::testStaticFunctionGetArgAllExtra(true, false)); } - public function testArrayFill() + public function testArrayFill(): void { $this->assertSame( [array_fill(0, 5, '?'), array_fill(0, 6, '?')], @@ -102,15 +108,15 @@ public function testArrayFill() ); } - public function testFunctionDeclaration() + public function testFunctionDeclaration(): void { - $this->assertSame('aaaaa', \Stub\zephir_namespaced_method_test('a')); - $this->assertTrue(\Stub\test_call_relative_object_hint(new PropertyAccess())); - $this->assertTrue(\Stub\test_call_object_hint(new PropertyAccess())); + $this->assertSame('aaaaa', zephir_namespaced_method_test('a')); + $this->assertTrue(test_call_relative_object_hint(new PropertyAccess())); + $this->assertTrue(test_call_object_hint(new PropertyAccess())); $this->assertSame('ab', zephir_global_method_test('ab/c')); - $this->assertInstanceOf(\stdClass::class, \Stub\zephir_namespaced_method_with_type_casting(new \stdClass())); + $this->assertInstanceOf(\stdClass::class, zephir_namespaced_method_with_type_casting(new \stdClass())); $this->assertInstanceOf(\stdClass::class, zephir_global_method_with_type_casting(new \stdClass())); } } diff --git a/tests/Extension/FetchTest.php b/tests/Extension/FetchTest.php index 8c4a766059..e07f16e380 100644 --- a/tests/Extension/FetchTest.php +++ b/tests/Extension/FetchTest.php @@ -1,21 +1,21 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class FetchTest extends TestCase +final class FetchTest extends TestCase { - public static $test; + public static ?\Stub\FetchTest $test = null; public static function setUpBeforeClass(): void { @@ -40,7 +40,7 @@ public static function tearDownAfterClass(): void self::$test = null; } - public function testPost() + public function testPost(): void { $this->assertSame(self::$test->testFetchPost(1), 'one'); $this->assertSame(self::$test->testFetchPost('two'), 2); @@ -54,17 +54,19 @@ public function testPost() * @param mixed $expected * @param mixed $has */ - public function testValue($input, $expected, $has) + public function testValue($input, $expected, $has): void { $this->assertSame(self::$test->hasValue($input), $has); $this->assertSame(self::$test->getValue($input), $expected); } - public function fieldProvider() + /** + * input, expected, exist + * + * @return array[] + */ + public function fieldProvider(): array { - /* - * input, expected, exist - */ return [ ['somePOST', 'some_post', true], ['VALUEPOST', 'some_post2', true], diff --git a/tests/Extension/FibonnaciTest.php b/tests/Extension/FibonnaciTest.php index 4bf6ffa34f..c74d3ca16b 100644 --- a/tests/Extension/FibonnaciTest.php +++ b/tests/Extension/FibonnaciTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Fibonnaci; -class FibonnaciTest extends TestCase +final class FibonnaciTest extends TestCase { - public function testMethods() + public function testMethods(): void { - $test = new \Stub\Fibonnaci(); + $test = new Fibonnaci(); $this->assertSame($test->fibInt(), 13); $this->assertSame($test->fibDouble(), 13.0); diff --git a/tests/Extension/Flow/SwitchFlowTest.php b/tests/Extension/Flow/SwitchFlowTest.php index 63b57e8c92..be80ecddea 100644 --- a/tests/Extension/Flow/SwitchFlowTest.php +++ b/tests/Extension/Flow/SwitchFlowTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Flow; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Flow\SwitchFlow; -class SwitchFlowTest extends TestCase +final class SwitchFlowTest extends TestCase { - public function testSwitch() + public function testSwitch(): void { $test = new SwitchFlow(); diff --git a/tests/Extension/FlowTest.php b/tests/Extension/FlowTest.php index fd3ddef4cc..a59d1e3154 100644 --- a/tests/Extension/FlowTest.php +++ b/tests/Extension/FlowTest.php @@ -1,29 +1,31 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Flow; -class FlowTest extends TestCase +final class FlowTest extends TestCase { - /** @var \Stub\Flow */ - private $test; + private Flow $test; protected function setUp(): void { - $this->test = new \Stub\Flow(); + $this->test = new Flow(); } - public function testIf() + public function testIf(): void { $this->assertSame($this->test->testIf1(), 1); $this->assertSame($this->test->testIf2(), 0); @@ -45,14 +47,14 @@ public function testIf() $this->assertFalse($this->test->testIf16(' ')); } - public function testLoop() + public function testLoop(): void { $this->assertTrue($this->test->testLoop1()); $this->assertSame($this->test->testLoop2(), 5); $this->assertSame($this->test->testLoop3(), 5); } - public function testWhile() + public function testWhile(): void { $this->assertSame($this->test->testWhile1(), 0); $this->assertSame($this->test->testWhile2(), 0); @@ -79,7 +81,7 @@ public function testWhile() ); } - public function testFor() + public function testFor(): void { $this->assertSame($this->test->testFor1(), 10); $this->assertSame($this->test->testFor2(), 6.0); diff --git a/tests/Extension/FunctionExistsTest.php b/tests/Extension/FunctionExistsTest.php index 629c0795e6..c9f20a2fd5 100644 --- a/tests/Extension/FunctionExistsTest.php +++ b/tests/Extension/FunctionExistsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,10 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\FunctionExists; -class FunctionExistsTest extends TestCase +final class FunctionExistsTest extends TestCase { - /** @var FunctionExists */ - private $test; + private FunctionExists $test; protected function setUp(): void { @@ -30,7 +31,7 @@ protected function setUp(): void * * @param string $func The internal (built-in) function name */ - public function testShouldCorrectDetectestExistenceWithPassedName($func) + public function testShouldCorrectDetectestExistenceWithPassedName(string $func): void { $this->assertTrue($this->test->testWithPassedName($func)); } @@ -38,7 +39,7 @@ public function testShouldCorrectDetectestExistenceWithPassedName($func) /** * @issue https://github.com/phalcon/zephir/issues/1547 */ - public function testShouldCorrectDetectestExistenceInsideTheZephirCode() + public function testShouldCorrectDetectestExistenceInsideTheZephirCode(): void { $expected = [ 'substr' => true, @@ -57,12 +58,12 @@ public function testShouldCorrectDetectestExistenceInsideTheZephirCode() /** * @issue https://github.com/phalcon/zephir/issues/1547 */ - public function testShouldCorrectDetectestExistenceByUsingString() + public function testShouldCorrectDetectestExistenceByUsingString(): void { $this->assertTrue($this->test->testWithString()); } - public function providerInternalFunctions() + public function providerInternalFunctions(): array { $allFunctions = get_defined_functions(); shuffle($allFunctions['internal']); diff --git a/tests/Extension/FunctionsTest.php b/tests/Extension/FunctionsTest.php index 697298f314..b37ffdeede 100644 --- a/tests/Extension/FunctionsTest.php +++ b/tests/Extension/FunctionsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; diff --git a/tests/Extension/Globals/EnvTest.php b/tests/Extension/Globals/EnvTest.php index dc4c83fc41..16e46d2470 100644 --- a/tests/Extension/Globals/EnvTest.php +++ b/tests/Extension/Globals/EnvTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Globals; @@ -14,7 +16,7 @@ use PHPUnit\Framework\TestCase; use Stub\Globals\Env; -class EnvTest extends TestCase +final class EnvTest extends TestCase { protected function setUp(): void { @@ -32,7 +34,7 @@ protected function setUp(): void } } - public function testEmpty() + public function testEmpty(): void { $tester = new Env(); $var = 'non-existing'; @@ -41,7 +43,7 @@ public function testEmpty() $this->assertSame(false, getenv($var)); } - public function testReadStandard() + public function testReadStandard(): void { $tester = new Env(); @@ -55,7 +57,7 @@ public function testReadStandard() $this->assertSame($_ENV[$var], getenv($var)); } - public function testReadNew() + public function testReadNew(): void { $_ENV['NEW_VARIABLEFROM'] = __FUNCTION__; $tester = new Env(); diff --git a/tests/Extension/Globals/PostTest.php b/tests/Extension/Globals/PostTest.php index 3a1dcc18a9..ef2b72113f 100644 --- a/tests/Extension/Globals/PostTest.php +++ b/tests/Extension/Globals/PostTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Globals; @@ -14,12 +16,12 @@ use PHPUnit\Framework\TestCase; use Stub\Globals\Post; -class PostTest extends TestCase +final class PostTest extends TestCase { /** * @issue https://github.com/phalcon/zephir/issues/1623 */ - public function testShouldNotTriggerAnyErrorIfPostIsUndefined() + public function testShouldNotTriggerAnyErrorIfPostIsUndefined(): void { $tester = new Post(); @@ -32,7 +34,7 @@ public function testShouldNotTriggerAnyErrorIfPostIsUndefined() /** * @issue https://github.com/phalcon/zephir/issues/1623 */ - public function testShouldReturnFalseIfVariableIsUndefined() + public function testShouldReturnFalseIfVariableIsUndefined(): void { $tester = new Post(); @@ -45,7 +47,7 @@ public function testShouldReturnFalseIfVariableIsUndefined() /** * @issue https://github.com/phalcon/zephir/issues/1623 */ - public function testShouldReturnTrueIfVariableIsDefined() + public function testShouldReturnTrueIfVariableIsDefined(): void { $tester = new Post(); diff --git a/tests/Extension/Globals/ServerRequestFactoryTest.php b/tests/Extension/Globals/ServerRequestFactoryTest.php index d3efa4b56e..fe1219bbf5 100644 --- a/tests/Extension/Globals/ServerRequestFactoryTest.php +++ b/tests/Extension/Globals/ServerRequestFactoryTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Globals; @@ -14,11 +16,11 @@ use PHPUnit\Framework\TestCase; use Stub\Globals\ServerRequestFactory; -class ServerRequestFactoryTest extends TestCase +final class ServerRequestFactoryTest extends TestCase { - private $server; - private $get; - private $post; + private array $server; + private array $get; + private array $post; protected function setUp(): void { @@ -37,7 +39,7 @@ protected function tearDown(): void /** * @issue https://github.com/phalcon/zephir/issues/1934 */ - public function testShouldNotTriggerAnyErrorIfPostIsUndefined() + public function testShouldNotTriggerAnyErrorIfPostIsUndefined(): void { $tester = new ServerRequestFactory(); diff --git a/tests/Extension/Globals/ServerTest.php b/tests/Extension/Globals/ServerTest.php index 4f8dd86fa7..718df93f6e 100644 --- a/tests/Extension/Globals/ServerTest.php +++ b/tests/Extension/Globals/ServerTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Globals; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Globals\Server; -class ServerTest extends TestCase +final class ServerTest extends TestCase { - private $server; + private array $server; protected function setUp(): void { @@ -31,7 +33,7 @@ protected function tearDown(): void /** * @see https://github.com/phalcon/zephir/issues/1961 */ - public function testShouldPrintPhpSelf() + public function testShouldPrintPhpSelf(): void { $test = new Server(); @@ -46,7 +48,7 @@ public function testShouldPrintPhpSelf() /** * @see https://github.com/phalcon/zephir/issues/1961 */ - public function testShouldPrintUserAgent() + public function testShouldPrintUserAgent(): void { $test = new Server(); $_SERVER['HTTP_USER_AGENT'] = 'Test'; diff --git a/tests/Extension/Globals/SessionTest.php b/tests/Extension/Globals/SessionTest.php index 9cd2b79f6c..6d917fa536 100644 --- a/tests/Extension/Globals/SessionTest.php +++ b/tests/Extension/Globals/SessionTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Globals; @@ -14,7 +16,7 @@ use PHPUnit\Framework\TestCase; use Stub\Globals\Session\Child; -class SessionTest extends TestCase +final class SessionTest extends TestCase { /** * This method is called before a test is executed. @@ -33,7 +35,7 @@ protected function tearDown(): void unset($_SESSION); } - public function testDestroy() + public function testDestroy(): void { $this->assertSame([], $_SESSION); @@ -50,7 +52,7 @@ public function testDestroy() $this->assertSame($_SESSION, $result); } - public function testDirectUnset() + public function testDirectUnset(): void { $this->assertSame([], $_SESSION); $_SESSION['bar'] = 'foo'; @@ -61,7 +63,7 @@ public function testDirectUnset() $this->assertSame([], $_SESSION); } - public function testRemove() + public function testRemove(): void { $this->assertSame([], $_SESSION); $_SESSION['foo'] = 'bar'; @@ -72,7 +74,7 @@ public function testRemove() $this->assertSame([], $_SESSION); } - public function testRemoveFromUnset() + public function testRemoveFromUnset(): void { $this->assertSame([], $_SESSION); $_SESSION['bar'] = 'foo'; diff --git a/tests/Extension/GlobalsTest.php b/tests/Extension/GlobalsTest.php index 02318633f3..c95191f1e8 100644 --- a/tests/Extension/GlobalsTest.php +++ b/tests/Extension/GlobalsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -17,17 +19,16 @@ /** * Extension\GlobalsTest. */ -class GlobalsTest extends TestCase +final class GlobalsTest extends TestCase { - /** @var \Stub\Globals */ - private $test; + private Globals $test; protected function setUp(): void { $this->test = new Globals(); } - public function testShouldGetGlobalExtensionSettings() + public function testShouldGetGlobalExtensionSettings(): void { $this->assertFalse($this->test->getDefaultGlobals1()); @@ -40,42 +41,42 @@ public function testShouldGetGlobalExtensionSettings() $this->assertSame(65, $this->test->getDefaultGlobals7()); } - public function testShouldSetGlobalExtensionSetting() + public function testShouldSetGlobalExtensionSetting(): void { $this->test->setBoolValueUsingDotNotation(false); $this->assertFalse($this->test->getDefaultGlobals1()); } - public function testSetIntValueUsingDotNotation() + public function testSetIntValueUsingDotNotation(): void { $this->test->setIntValueUsingDotNotation(900); $this->assertSame(900, $this->test->getDefaultGlobals2()); } - public function testSetCharValueUsingString() + public function testSetCharValueUsingString(): void { $this->test->setCharValue('B'); $this->assertSame(66, $this->test->getDefaultGlobals7()); } - public function testSetCharValueUsingInt() + public function testSetCharValueUsingInt(): void { $this->test->setCharValue(90); $this->assertSame(90, $this->test->getDefaultGlobals7()); } - public function testSetBoolValueUsingInt() + public function testSetBoolValueUsingInt(): void { $this->test->setBoolValue(0); $this->assertFalse($this->test->getDefaultGlobals4()); } - public function testSetBoolValueUsingBool() + public function testSetBoolValueUsingBool(): void { $this->test->setBoolValue(true); $this->assertTrue($this->test->getDefaultGlobals4()); @@ -84,7 +85,7 @@ public function testSetBoolValueUsingBool() $this->assertFalse($this->test->getDefaultGlobals4()); } - public function testShouldSetGlobalExtensionOrmCacheLevel() + public function testShouldSetGlobalExtensionOrmCacheLevel(): void { $this->test->setDefaultGlobalsOrmCacheLevel(3); diff --git a/tests/Extension/InstanceOffTest.php b/tests/Extension/InstanceOffTest.php index d570e1afd9..16a3f9defd 100644 --- a/tests/Extension/InstanceOffTest.php +++ b/tests/Extension/InstanceOffTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -16,30 +18,29 @@ class InstanceOffTest extends TestCase { - /** @var InstanceOff */ - private $test; + private InstanceOff $test; protected function setUp(): void { $this->test = new InstanceOff(); } - public function testInstanceOf1() + public function testInstanceOf1(): void { $this->assertTrue($this->test->testInstanceOf1()); } - public function testInstanceOf2() + public function testInstanceOf2(): void { $this->assertTrue($this->test->testInstanceOf2()); } - public function testInstanceOf3() + public function testInstanceOf3(): void { $this->assertFalse($this->test->testInstanceOf3()); } - public function testInstanceOf4() + public function testInstanceOf4(): void { $this->assertTrue($this->test->testInstanceOf4(new \ArrayIterator([]))); $this->assertTrue($this->test->testInstanceOf4(new \ArrayObject())); @@ -54,47 +55,42 @@ public function testInstanceOf4() } /** - * @see https://github.com/phalcon/zephir/issues/776 + * @issue https://github.com/phalcon/zephir/issues/776 + * @issue https://github.com/phalcon/zephir/issues/822 */ - public function testInstanceOf5() + public function testInstanceOf5(): void { $this->assertTrue($this->test->testInstanceOf5($this->test)); - - /* - * Cannot test instance of for not objects - * @link https://github.com/phalcon/zephir/issues/822 - */ - $this->assertFalse($this->test->testInstanceOf5(new \stdClass())); } - public function testInstanceOf6() + public function testInstanceOf6(): void { $this->assertTrue($this->test->testInstanceOf6()); } /** - * @see https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/phalcon/zephir/issues/1828 */ - public function testInstanceOf7() + public function testInstanceOf7(): void { $this->assertTrue($this->test->testInstanceOf7($this->test)); $this->assertFalse($this->test->testInstanceOf7(new \stdClass())); } /** - * @see https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/phalcon/zephir/issues/1828 */ - public function testInstanceOf8() + public function testInstanceOf8(): void { $this->assertTrue($this->test->testInstanceOf8('\\Stub\\InstanceOff')); $this->assertFalse($this->test->testInstanceOf8('\\stdClass')); } /** - * @see https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/phalcon/zephir/issues/1828 */ - public function testInstanceOf9() + public function testInstanceOf9(): void { $this->assertTrue($this->test->testInstanceOf9($this->test, '\\Stub\\InstanceOff')); $this->assertFalse($this->test->testInstanceOf9($this->test, '\\stdClass')); diff --git a/tests/Extension/InstanceTest.php b/tests/Extension/InstanceTest.php index f0d5be5788..d35a999d0e 100644 --- a/tests/Extension/InstanceTest.php +++ b/tests/Extension/InstanceTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,12 +16,12 @@ use PHPUnit\Framework\TestCase; use Stub\Instance; -class InstanceTest extends TestCase +final class InstanceTest extends TestCase { /** * @issue https://github.com/phalcon/zephir/issues/1339 */ - public function testShouldCreateAnInstanceUsingMoreThan10Parameters() + public function testShouldCreateAnInstanceUsingMoreThan10Parameters(): void { $this->assertInstanceOf(Instance::class, Instance::testIssue1339()); } diff --git a/tests/Extension/Integral/FannkuchTest.php b/tests/Extension/Integral/FannkuchTest.php index 9bc33dc586..c724a9a35e 100644 --- a/tests/Extension/Integral/FannkuchTest.php +++ b/tests/Extension/Integral/FannkuchTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Integral; use PHPUnit\Framework\TestCase; +use Stub\Fannkuch; -class FannkuchTest extends TestCase +final class FannkuchTest extends TestCase { - public function testFannkuch() + public function testFannkuch(): void { - $test = new \Stub\Fannkuch(); + $test = new Fannkuch(); $this->assertSame($test->process(5), [11, 5, 7]); } } diff --git a/tests/Extension/Integral/RegexDNATest.php b/tests/Extension/Integral/RegexDNATest.php index 348086a35c..ed38c6032e 100644 --- a/tests/Extension/Integral/RegexDNATest.php +++ b/tests/Extension/Integral/RegexDNATest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Integral; use PHPUnit\Framework\TestCase; +use Stub\RegexDNA; -class RegexDNATest extends TestCase +final class RegexDNATest extends TestCase { - public function testProcess() + public function testProcess(): void { - $test = new \Stub\RegexDNA(); + $test = new RegexDNA(); ob_start(); $test->process(\dirname(__DIR__).'/../fixtures/regexdna/input.txt'); diff --git a/tests/Extension/Integral/SortTest.php b/tests/Extension/Integral/SortTest.php index 8104257bfd..8158f07b35 100644 --- a/tests/Extension/Integral/SortTest.php +++ b/tests/Extension/Integral/SortTest.php @@ -1,26 +1,29 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Integral; use PHPUnit\Framework\TestCase; +use Stub\Sort; -class SortTest extends TestCase +final class SortTest extends TestCase { - public function testSort() + public function testSort(): void { $data = $original = range(1, 50); shuffle($data); - $test = new \Stub\Sort(); + $test = new Sort(); $this->assertSame($test->quick($data), $original); } } diff --git a/tests/Extension/Interfaces/InterfaceMethodSignatureTest.php b/tests/Extension/Interfaces/InterfaceMethodSignatureTest.php index 8dcd622e91..ff77315a95 100644 --- a/tests/Extension/Interfaces/InterfaceMethodSignatureTest.php +++ b/tests/Extension/Interfaces/InterfaceMethodSignatureTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -/* +/** * This file is part of the Zephir. * * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Interfaces; diff --git a/tests/Extension/InternalClassesTest.php b/tests/Extension/InternalClassesTest.php index 0335a0eca2..a95ee585d9 100644 --- a/tests/Extension/InternalClassesTest.php +++ b/tests/Extension/InternalClassesTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -16,9 +18,9 @@ use PHPUnit\Framework\TestCase; use Stub\InternalClasses; -class InternalClassesTest extends TestCase +final class InternalClassesTest extends TestCase { - public function testStaticMethodCall() + public function testStaticMethodCall(): void { if (false === class_exists(Di::class)) { $this->markTestSkipped('Class Phalcon\Di not found'); @@ -28,7 +30,7 @@ public function testStaticMethodCall() $this->assertSame(Di::getDefault(), $class->testStaticCall()); } - public function testStaticPropertyFetch() + public function testStaticPropertyFetch(): void { if (false === class_exists(Query::class)) { $this->markTestSkipped('Class Phalcon\Mvc\Model\Query not found'); diff --git a/tests/Extension/InvokeTest.php b/tests/Extension/InvokeTest.php index e22ba35992..ee3ab11202 100644 --- a/tests/Extension/InvokeTest.php +++ b/tests/Extension/InvokeTest.php @@ -1,26 +1,29 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Invoke; use Stub\Invokes\InvokeProtected; use Stub\Invokes\InvokeProtectedComplex; -class InvokeTest extends TestCase +final class InvokeTest extends TestCase { public function testIssue1522(): void { - $x1 = \Stub\Invoke::test(); - $x2 = \Stub\Invoke::test(); + $x1 = Invoke::test(); + $x2 = Invoke::test(); $this->assertSame('string', $x1); $this->assertSame('string', $x2); } diff --git a/tests/Extension/IssetTest.php b/tests/Extension/IssetTest.php index c6c5891dd7..34c598a36f 100644 --- a/tests/Extension/IssetTest.php +++ b/tests/Extension/IssetTest.php @@ -1,32 +1,38 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class IssetTest extends TestCase +final class IssetTest extends TestCase { - public $b = 'a'; - private $test2 = 'b'; + public string $b = 'a'; + private \Stub\IssetTest $test; - /** @var \Stub\IssetTest */ - private $test; + /** + * This property is used during test + * + * @var mixed + */ + private $test2; protected function setUp(): void { $this->test = new \Stub\IssetTest(); } - public function testIssetArray() + public function testIssetArray(): void { $testArray = ['a', 'abc' => 'def', 'gef' => '123']; $this->assertTrue($this->test->testIssetArray1($testArray, 'abc')); @@ -36,15 +42,15 @@ public function testIssetArray() $this->assertTrue(!$this->test->testIssetArray5($testArray)); } - public function testIssetProperties() + public function testIssetProperties(): void { $this->assertTrue($this->test->testIssetProperty1($this)); $this->assertTrue($this->test->testIssetProperty2($this, 'test2')); - $this->assertTrue(!$this->test->testIssetProperty2($this, 'test3')); + $this->assertFalse($this->test->testIssetProperty2($this, 'test3')); $this->assertTrue($this->test->testIssetProperty3($this)); } - public function testIssetDynamicProperty() + public function testIssetDynamicProperty(): void { $this->assertTrue($this->test->testIssetDynamicProperty1()); $this->assertTrue(!$this->test->testIssetDynamicProperty2($this)); diff --git a/tests/Extension/Issue1521Test.php b/tests/Extension/Issue1521Test.php index 0e35f5247e..0819557ae7 100644 --- a/tests/Extension/Issue1521Test.php +++ b/tests/Extension/Issue1521Test.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Issue1521; -class Issue1521Test extends TestCase +final class Issue1521Test extends TestCase { - public function testIssue1521() + public function testIssue1521(): void { - $test = new \Stub\Issue1521(); + $test = new Issue1521(); $actual = $test->test(); $this->assertTrue('0' === $actual['zero']); diff --git a/tests/Extension/JsonTest.php b/tests/Extension/JsonTest.php index e33016cf6d..f2487c87eb 100644 --- a/tests/Extension/JsonTest.php +++ b/tests/Extension/JsonTest.php @@ -1,36 +1,38 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Json; -class JsonTest extends TestCase +final class JsonTest extends TestCase { - /** @var \Stub\Json */ - private $test; + private Json $test; protected function setUp(): void { - $this->test = new \Stub\Json(); + $this->test = new Json(); } - public function testEncode() + public function testEncode(): void { $this->assertSame($this->test->testEncodeObject(), '{"a":"hello","b":"world","c":128}'); $this->assertSame($this->test->testEncodeArray(), '[1,2,3]'); $this->assertSame($this->test->testEncodeOptions(), '["\\u003Cfoo\\u003E","\'bar\'","&blong&","\\u00e9"]'); } - public function testDecode() + public function testDecode(): void { $obj1 = $this->test->testDecodeObject(); $this->assertSame($obj1->a, 'hello'); diff --git a/tests/Extension/MCallDynamicTest.php b/tests/Extension/MCallDynamicTest.php index 2a3061dc4a..528e23124e 100644 --- a/tests/Extension/MCallDynamicTest.php +++ b/tests/Extension/MCallDynamicTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\McallDynamic; -class MCallDynamicTest extends TestCase +final class MCallDynamicTest extends TestCase { - public function testCallDynamic() + public function testCallDynamic(): void { $test = new McallDynamic(); $this->assertSame(1, $test->method1()); @@ -24,9 +26,9 @@ public function testCallDynamic() } /** - * @see https://github.com/phalcon/zephir/issues/1751 + * @issue https://github.com/phalcon/zephir/issues/1751 */ - public function testCallAnonymousFunctionWithContext() + public function testCallAnonymousFunctionWithContext(): void { $test = new McallDynamic(); diff --git a/tests/Extension/MCallTest.php b/tests/Extension/MCallTest.php index 639ad71443..30cb08ca2a 100644 --- a/tests/Extension/MCallTest.php +++ b/tests/Extension/MCallTest.php @@ -1,26 +1,32 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use ReflectionClass; +use ReflectionException; +use ReflectionParameter; use Stub\Mcall; +use Stub\Oo\Param; -class MCallTest extends TestCase +final class MCallTest extends TestCase { - /** @var \ReflectionClass */ + /** + * @var mixed + */ private $reflection; - - /** @var Mcall */ - private $test; + private Mcall $test; protected function setUp(): void { @@ -136,16 +142,11 @@ public function testObjectParamCastOoParam(): void $this->assertNumberOfParameters(1); $this->assertNumberOfRequiredParameters(1); - $this->assertSame(\Stub\Oo\Param::class, $this->getMethodFirstParameter()->getType()->getName()); - $this->assertInstanceOf(\Stub\Oo\Param::class, $this->test->testObjectParamCastOoParam(new \Stub\Oo\Param())); + $this->assertSame(Param::class, $this->getMethodFirstParameter()->getType()->getName()); + $this->assertInstanceOf(Param::class, $this->test->testObjectParamCastOoParam(new Param())); } - /** - * @return \ReflectionParameter - * - * @throws \ReflectionException - */ - protected function getMethodFirstParameter() + protected function getMethodFirstParameter(): ReflectionParameter { $methodInfo = $this->reflection->getMethod($this->getName()); $parameters = $methodInfo->getParameters(); @@ -153,16 +154,19 @@ protected function getMethodFirstParameter() return $parameters[0]; } + /** + * @return mixed|ReflectionClass + */ private function getReflection() { if (null === $this->reflection) { - return $this->reflection = new \ReflectionClass(\Stub\Mcall::class); + return $this->reflection = new ReflectionClass(Mcall::class); } return $this->reflection; } - public function testSouldThrowTypeErrorForOptionalBoolean1() + public function testSouldThrowTypeErrorForOptionalBoolean1(): void { $test = new Mcall(); @@ -175,7 +179,7 @@ public function testSouldThrowTypeErrorForOptionalBoolean1() $test->optionalParameterBoolean('test'); } - public function testShouldThrowTypeErrorForOptionalBoolean2() + public function testShouldThrowTypeErrorForOptionalBoolean2(): void { $test = new Mcall(); diff --git a/tests/Extension/McallChainedTest.php b/tests/Extension/McallChainedTest.php index f672b0c93c..10c01ce4f5 100644 --- a/tests/Extension/McallChainedTest.php +++ b/tests/Extension/McallChainedTest.php @@ -1,39 +1,41 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\McallChained; -class McallChainedTest extends TestCase +final class McallChainedTest extends TestCase { - /** @var \Stub\McallChained */ - private $test; + private McallChained $test; protected function setUp(): void { - $this->test = new \Stub\McallChained(); + $this->test = new McallChained(); } - public function testChained1() + public function testChained1(): void { $this->assertSame($this->test->testChained1(), $this->test); } - public function testChained2() + public function testChained2(): void { $this->assertSame($this->test->testChained2(), $this->test); } - public function testChained3() + public function testChained3(): void { $this->assertSame($this->test->testChained3(), $this->test); } diff --git a/tests/Extension/McallInternalTest.php b/tests/Extension/McallInternalTest.php index 2e926532a4..6f396a4025 100644 --- a/tests/Extension/McallInternalTest.php +++ b/tests/Extension/McallInternalTest.php @@ -1,16 +1,27 @@ + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + namespace Extension; use PHPUnit\Framework\TestCase; use Stub\McallInternal; -class McallInternalTest extends TestCase +final class McallInternalTest extends TestCase { /** - * @see https://github.com/phalcon/zephir/issues/1956 + * @issue https://github.com/phalcon/zephir/issues/1956 */ - public function testShouldReturnInstance() + public function testShouldReturnInstance(): void { $test = new McallInternal(); $this->assertInstanceOf(McallInternal::class, $test->issue1956()); diff --git a/tests/Extension/MethodArgsTest.php b/tests/Extension/MethodArgsTest.php index 2dd9fd5c69..7291cf6a8b 100644 --- a/tests/Extension/MethodArgsTest.php +++ b/tests/Extension/MethodArgsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,16 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\MethodArgs; -class MethodArgsTest extends TestCase +final class MethodArgsTest extends TestCase { - private $test; + private MethodArgs $test; protected function setUp(): void { $this->test = new MethodArgs(); } - public function testCallable() + public function testCallable(): void { $callback = function () { }; @@ -39,7 +41,7 @@ public function testCallable() $this->test->setCallableStrict(true); } - public function testObject() + public function testObject(): void { $obj = new \stdClass(); @@ -54,7 +56,7 @@ public function testObject() $this->test->setObjectStrict(true); } - public function testResource() + public function testResource(): void { $this->test->setResourceStrict(STDIN); $this->assertSame(STDIN, $this->test->a); @@ -68,7 +70,7 @@ public function testResource() $this->test->setResourceStrict(true); } - public function testMethodOptionalValueWithDefaultStaticConstantAccess() + public function testMethodOptionalValueWithDefaultStaticConstantAccess(): void { $this->assertSame('test', $this->test->methodOptionalValueWithDefaultStaticConstantAccess('test')); diff --git a/tests/Extension/NativeArrayTest.php b/tests/Extension/NativeArrayTest.php index d88aa44b24..5a08a6c5aa 100644 --- a/tests/Extension/NativeArrayTest.php +++ b/tests/Extension/NativeArrayTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\NativeArray; -class NativeArrayTest extends TestCase +final class NativeArrayTest extends TestCase { - /** @var NativeArray */ - private $test; + private NativeArray $test; protected function setUp(): void { $this->test = new NativeArray(); } - public function testArray() + public function testArray(): void { $this->assertSame([], $this->test->testArray1()); $this->assertSame([1, 2, 3], $this->test->testArray2()); @@ -52,7 +53,7 @@ public function testArray() $this->assertSame([0 => 0.0, 1 => 0.0, 2 => 0.0], $this->test->testArray24()); } - public function testArrayAccess() + public function testArrayAccess(): void { $this->assertSame(1, $this->test->testArrayAccess1()); $this->assertSame(1, $this->test->testArrayAccess2()); @@ -61,7 +62,7 @@ public function testArrayAccess() $this->assertSame(1, $this->test->testArrayAccess5()); } - public function testArrayMultipleAccess() + public function testArrayMultipleAccess(): void { $this->assertSame('a', $this->test->testArrayMultipleAccess1()); $this->assertSame('b', $this->test->testArrayMultipleAccess2()); @@ -70,7 +71,7 @@ public function testArrayMultipleAccess() $this->assertSame(0, $this->test->testArrayMultipleAccess5()); } - public function testArrayUpdate() + public function testArrayUpdate(): void { $this->assertSame([4, 2, 3], $this->test->testArrayUpdate1()); $this->assertSame([4, 2, 3], $this->test->testArrayUpdate2()); @@ -78,7 +79,7 @@ public function testArrayUpdate() $this->assertSame(['a' => 4, 'b' => 2, 'c' => 3], $this->test->testArrayUpdate4()); } - public function testMultipleArrayUpdate() + public function testMultipleArrayUpdate(): void { $this->assertSame(['x' => ['y' => null]], $this->test->testMultipleArrayUpdate1()); $this->assertSame(['x' => ['y' => ['z' => null]]], $this->test->testMultipleArrayUpdate2()); @@ -94,28 +95,28 @@ public function testMultipleArrayUpdate() $this->assertSame(['y' => ['x' => ['z' => null]]], $this->test->testMultipleArrayUpdate12()); } - public function testArrayKeys() + public function testArrayKeys(): void { $this->assertSame(['test1', 'test2', 'test3'], $this->test->testArrayKeys(['test1' => 1, 'test2' => 2, 'test3' => 3])); $this->assertSame([0, 1, 2, 3, 4, 5], $this->test->testArrayKeys([1, 2, 3, 4, 5, 6])); } - public function testImplodeArray() + public function testImplodeArray(): void { $this->assertSame('test1|test2|test3', $this->test->testImplodeArray(['test1' => 1, 'test2' => 2, 'test3' => 3])); } - public function testIssue110() + public function testIssue110(): void { $this->assertSame('B|K|M|G|T|KB|MB|GB|TB', $this->test->issue110()); } - public function testIssue264() + public function testIssue264(): void { $this->assertFalse($this->test->issue264([1, 2, 3])); } - public function testIssue743() + public function testIssue743(): void { $this->test->issue743a([42 => []]); @@ -153,17 +154,20 @@ public function testIssue743() $this->assertSame($expected, $this->test->issue743c(['str' => ['hey' => new \stdClass()]])); } - public function testIssue709() + public function testIssue709(): void { $this->assertTrue($this->test->Issue709()); } - public function testIssue1140() + public function testIssue1140(): void { - $this->assertSame(['phalcon' => ['/var/www/html/phalcon']], $this->test->Issue1140('phalcon', '/var/www/html/phalcon')); + $this->assertSame( + ['phalcon' => ['/var/www/html/phalcon']], + $this->test->Issue1140('phalcon', '/var/www/html/phalcon') + ); } - public function testIssue1159() + public function testIssue1159(): void { $this->assertSame([1], $this->test->Issue1159()); } diff --git a/tests/Extension/NewInstanceOperatorTest.php b/tests/Extension/NewInstanceOperatorTest.php index 0660cdbbc6..2c1f44c89b 100644 --- a/tests/Extension/NewInstanceOperatorTest.php +++ b/tests/Extension/NewInstanceOperatorTest.php @@ -1,24 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Operator; -class NewInstanceOperatorTest extends TestCase +final class NewInstanceOperatorTest extends TestCase { - /** @var \Stub\Operator */ - public $test; + public Operator $test; - protected $autoloadMap = [ + protected array $autoloadMap = [ 'Fixture\ThrowException' => ZEPHIRPATH.'/tests/fixtures/throw-exception.php', 'Fixture\EmptyClass' => ZEPHIRPATH.'/tests/fixtures/class-empty.php', ]; @@ -26,7 +28,7 @@ class NewInstanceOperatorTest extends TestCase protected function setUp(): void { spl_autoload_register([$this, 'autoload']); - $this->test = new \Stub\Operator(); + $this->test = new Operator(); } protected function tearDown(): void @@ -34,20 +36,20 @@ protected function tearDown(): void spl_autoload_unregister([$this, 'autoload']); } - public function autoload($className) + public function autoload(string $className): void { if (isset($this->autoloadMap[$className])) { include $this->autoloadMap[$className]; } } - public function testException() + public function testException(): void { $this->expectException(\Exception::class); - $obj = $this->test->testNewInstanceOperator('Fixture\ThrowException'); + $this->test->testNewInstanceOperator('Fixture\ThrowException'); } - public function testNewInstance() + public function testNewInstance(): void { $object = $this->test->testNewInstanceOperator('Fixture\EmptyClass'); diff --git a/tests/Extension/Oo/ExtendClassTest.php b/tests/Extension/Oo/ExtendClassTest.php index f7bb4a04e8..b1d130db5d 100644 --- a/tests/Extension/Oo/ExtendClassTest.php +++ b/tests/Extension/Oo/ExtendClassTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Oo; @@ -17,7 +19,7 @@ use Stub\Oo\ConcreteStatic; use Stub\Oo\ExtendPdoClass; -class ExtendClassTest extends TestCase +final class ExtendClassTest extends TestCase { public function testPDOExtending(): void { @@ -31,10 +33,6 @@ public function testPDOExtending(): void public function testPDOStatementExtending(): void { - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - //$this->markTestSkipped('TypeError : PHPUnit\Framework\TestCase::__construct(): Argument #2 ($data) must be of type array, string given'); - } - $pdo = new ExtendPdoClass('sqlite::memory:', '', '', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); $stmt = $pdo->prepare('SELECT CURRENT_TIME'); @@ -68,10 +66,6 @@ public function testShouldCorrectWorkWithLateStaticBinding(): void */ public function testShouldCallParentMethodFromStaticByUsingSelf(): void { - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - //$this->markTestSkipped('Should be fixed static call before run this test (Invalid callback , no array or string given)'); - } - $this->assertSame('ConcreteStatic:parentFunction', ConcreteStatic::parentFunction()); $this->assertSame('ConcreteStatic:parentFunction', ConcreteStatic::childFunction()); } diff --git a/tests/Extension/Oo/OoParamsStrictTest.php b/tests/Extension/Oo/OoParamsStrictTest.php index c65ad891c6..27c97140f4 100644 --- a/tests/Extension/Oo/OoParamsStrictTest.php +++ b/tests/Extension/Oo/OoParamsStrictTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -/* +/** * This file is part of the Zephir. * * (c) Phalcon Team * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Oo; @@ -16,32 +16,31 @@ use PHPUnit\Framework\TestCase; use Stub\Oo\OoParams; -class OoParamsStrictTest extends TestCase +final class OoParamsStrictTest extends TestCase { - /** @var OoParams */ - private $test; + private OoParams $test; protected function setUp(): void { $this->test = new OoParams(); } - public function testSetStrictAgeSuccess() + public function testSetStrictAgeSuccess(): void { $this->assertSame($this->test->setStrictAge(17), 17); } - public function testSetStrictAverageSuccess() + public function testSetStrictAverageSuccess(): void { $this->assertSame($this->test->setStrictAverage(17.1), 17.1); } - public function testSetStrictNameSuccess() + public function testSetStrictNameSuccess(): void { $this->assertSame($this->test->setStrictName('peter'), 'peter'); } - public function testShouldThrowTypeErrorForInt1() + public function testShouldThrowTypeErrorForInt1(): void { $this->expectException(\Error::class); $this->expectExceptionMessageRegExp( @@ -52,7 +51,7 @@ public function testShouldThrowTypeErrorForInt1() $this->test->setStrictAge(17.0); } - public function testShouldThrowInvalidArgumentExceptionForInt2() + public function testShouldThrowInvalidArgumentExceptionForInt2(): void { $this->expectException(\Error::class); $this->expectExceptionMessageRegExp( @@ -63,7 +62,7 @@ public function testShouldThrowInvalidArgumentExceptionForInt2() $this->test->setStrictAge('17'); } - public function testShouldThrowInvalidArgumentExceptionForDouble() + public function testShouldThrowInvalidArgumentExceptionForDouble(): void { if (version_compare(PHP_VERSION, '8.0.0', '>=')) { $this->expectException(\InvalidArgumentException::class); @@ -78,7 +77,7 @@ public function testShouldThrowInvalidArgumentExceptionForDouble() $this->test->setStrictAverage('a'); } - public function testShouldThrowInvalidArgumentExceptionForString() + public function testShouldThrowInvalidArgumentExceptionForString(): void { $this->expectException(\Error::class); $this->expectExceptionMessageRegExp( @@ -89,7 +88,7 @@ public function testShouldThrowInvalidArgumentExceptionForString() $this->test->setStrictName(1234); } - public function testShouldThrowInvalidArgumentExceptionForCallFromZephirLand() + public function testShouldThrowInvalidArgumentExceptionForCallFromZephirLand(): void { if (version_compare(PHP_VERSION, '8.0.0', '>=')) { $this->markTestSkipped('Move types check into fcall, instead of PHP_METHOD'); diff --git a/tests/Extension/Oo/OoParamsTest.php b/tests/Extension/Oo/OoParamsTest.php index 2062801840..2208a35dc1 100644 --- a/tests/Extension/Oo/OoParamsTest.php +++ b/tests/Extension/Oo/OoParamsTest.php @@ -1,29 +1,29 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Oo; use PHPUnit\Framework\TestCase; +use Stub\Oo\OoParams; -class OoParamsTest extends TestCase +final class OoParamsTest extends TestCase { - /** @var \Stub\Oo\OoParams */ - private $test; + private OoParams $test; protected function setUp(): void { - $this->test = new \Stub\Oo\OoParams(); + $this->test = new OoParams(); } - public function testOoParams() + public function testOoParams(): void { $this->assertInstanceOf('Stub\Oo\OoParams', $this->test->createThisClassWithoutWriteCurrentNamespace()); $this->assertinstanceOf('Stub\Oo\OoDynamicA', $this->test->createOtherClassWithoutWriteCurrentNamespace()); @@ -51,7 +51,7 @@ public function testOoParams() $this->assertSame($this->test->setList([]), []); } - public function setObjectClassCast() + public function setObjectClassCast(): void { $result = $this->test->setStrictName(new \Stub\Oo\Param()); diff --git a/tests/Extension/Oo/Scopes/PrivateScopeTest.php b/tests/Extension/Oo/Scopes/PrivateScopeTest.php index e1a9eef83e..7926199d4b 100644 --- a/tests/Extension/Oo/Scopes/PrivateScopeTest.php +++ b/tests/Extension/Oo/Scopes/PrivateScopeTest.php @@ -1,6 +1,8 @@ @@ -20,10 +22,11 @@ use TestScopePhp; use TestScopePhpMagic; use TestScopePhpMagicExtending; +use UserExample; -class PrivateScopeTest extends TestCase +final class PrivateScopeTest extends TestCase { - public function testShouldCallPrivateMethod() + public function testShouldCallPrivateMethod(): void { $this->assertSame('isPrivate', (new PrivateScopeTester())->run()); } @@ -31,7 +34,7 @@ public function testShouldCallPrivateMethod() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyObjPhp() + public function testShouldNotSetPrivatePropertyObjPhp(): void { $this->expectException(Error::class); $this->expectExceptionMessage( @@ -45,7 +48,7 @@ public function testShouldNotSetPrivatePropertyObjPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyNewPhp() + public function testShouldNotSetPrivatePropertyNewPhp(): void { $this->expectException(Error::class); $this->expectExceptionMessage( @@ -59,7 +62,7 @@ public function testShouldNotSetPrivatePropertyNewPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyObjInternal() + public function testShouldNotSetPrivatePropertyObjInternal(): void { $this->expectException(Error::class); $this->expectExceptionMessage( @@ -73,7 +76,7 @@ public function testShouldNotSetPrivatePropertyObjInternal() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyNewInternal() + public function testShouldNotSetPrivatePropertyNewInternal(): void { $this->expectException(Error::class); $this->expectExceptionMessage( @@ -87,7 +90,7 @@ public function testShouldNotSetPrivatePropertyNewInternal() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldSetPrivatePropertyObjPhp() + public function testShouldSetPrivatePropertyObjPhp(): void { $object = new TestScopePhpMagic(); $tester = new PrivateScopeTester(); @@ -100,7 +103,7 @@ public function testShouldSetPrivatePropertyObjPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldSetPrivatePropertyNewPhp() + public function testShouldSetPrivatePropertyNewPhp(): void { $tester = new PrivateScopeTester(); $obj = $tester->setPropertyNew(TestScopePhpMagic::class, 'privateProperty', 'test'); @@ -112,7 +115,7 @@ public function testShouldSetPrivatePropertyNewPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldSetPrivatePropertyObjInternal() + public function testShouldSetPrivatePropertyObjInternal(): void { $tester = new PrivateScopeTester(); $object = new TestScopeExtendingMagic(); @@ -125,7 +128,7 @@ public function testShouldSetPrivatePropertyObjInternal() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldSetPrivatePropertyNewInternal() + public function testShouldSetPrivatePropertyNewInternal(): void { $tester = new PrivateScopeTester(); $obj = $tester->setPropertyNew(TestScopeExtendingMagic::class, 'privateProperty', 'test'); @@ -137,7 +140,7 @@ public function testShouldSetPrivatePropertyNewInternal() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyViaThis() + public function testShouldNotSetPrivatePropertyViaThis(): void { $this->expectException(Error::class); $this->expectExceptionMessage( @@ -151,7 +154,7 @@ public function testShouldNotSetPrivatePropertyViaThis() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldSetPrivatePropertyViaThis() + public function testShouldSetPrivatePropertyViaThis(): void { $obj = new TestScopeExtending(); $obj->setProperty('privateProperty2', 'test'); @@ -162,66 +165,42 @@ public function testShouldSetPrivatePropertyViaThis() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyExtendedMagicObjInternal() + public function testShouldNotSetPrivatePropertyExtendedMagicObjInternal(): void { - if (\PHP_VERSION_ID >= 70400) { - $this->expectException(Error::class); - $this->expectExceptionMessage( - 'Cannot access private property TestScopeExtendingMagic::$privateProperty2' - ); - } + $this->expectException(Error::class); + $this->expectExceptionMessage( + 'Cannot access private property TestScopeExtendingMagic::$privateProperty2' + ); $object = new TestScopeExtendingMagic(); $tester = new PrivateScopeTester(); $this->assertEquals('private', $object->getPrivateProperty2()); $tester->setPropertyObj($object, 'privateProperty2', 'CHANGED'); - - // This related the way PHP < 7.4 handles object's properties when - // there is a magic __set method present. - // - // Actually we DO NOT change property here (fixed). However, only - // PHP 7.4 throws a fatal error. All previous versions just out a - // notice and continue to execution. - if (\PHP_VERSION_ID < 70400) { - $this->assertEquals('private', $object->getPrivateProperty2()); - } } /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyExtendedMagicNewInternal() + public function testShouldNotSetPrivatePropertyExtendedMagicNewInternal(): void { - if (\PHP_VERSION_ID >= 70400) { - $this->expectException(Error::class); - $this->expectExceptionMessage( - 'Cannot access private property TestScopeExtendingMagic::$privateProperty2' - ); - } + $this->expectException(Error::class); + $this->expectExceptionMessage( + 'Cannot access private property TestScopeExtendingMagic::$privateProperty2' + ); $tester = new PrivateScopeTester(); - $object = $tester->setPropertyNew( + $tester->setPropertyNew( TestScopeExtendingMagic::class, 'privateProperty2', 'CHANGED' ); - - // This related the way PHP < 7.4 handles object's properties when - // there is a magic __set method present. - // - // Actually we DO NOT change property here (fixed). However, only - // PHP 7.4 throws a fatal error. All previous versions just out a - // notice and continue to execution. - if (\PHP_VERSION_ID < 70400) { - $this->assertEquals('private', $object->getPrivateProperty2()); - } } /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyExtendedMagicObjPhp() + public function testShouldNotSetPrivatePropertyExtendedMagicObjPhp(): void { if (\PHP_VERSION_ID < 70400) { $this->expectException(Notice::class); @@ -244,37 +223,25 @@ public function testShouldNotSetPrivatePropertyExtendedMagicObjPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotSetPrivatePropertyExtendedMagicNewPhp() + public function testShouldNotSetPrivatePropertyExtendedMagicNewPhp(): void { - if (\PHP_VERSION_ID >= 70400) { - $this->expectException(Error::class); - $this->expectExceptionMessage( - 'Cannot access private property TestScopePhpMagicExtending::$privateProperty2' - ); - } + $this->expectException(Error::class); + $this->expectExceptionMessage( + 'Cannot access private property TestScopePhpMagicExtending::$privateProperty2' + ); $tester = new PrivateScopeTester(); - $object = $tester->setPropertyNew( + $tester->setPropertyNew( TestScopePhpMagicExtending::class, 'privateProperty2', 'CHANGED' ); - - // This related the way PHP < 7.4 handles object's properties when - // there is a magic __set method present. - // - // Actually we DO NOT change property here (fixed). However, only - // PHP 7.4 throws a fatal error. All previous versions just out a - // notice and continue to execution. - if (\PHP_VERSION_ID < 70400) { - $this->assertEquals('private2', $object->getPrivateProperty2()); - } } /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotGetObjectVarsPrivatePropertyObjPhp() + public function testShouldNotGetObjectVarsPrivatePropertyObjPhp(): void { $tester = new PrivateScopeTester(); $object = new TestScopePhp(); @@ -286,7 +253,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyObjPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotGetObjectVarsPrivatePropertyNewPhp() + public function testShouldNotGetObjectVarsPrivatePropertyNewPhp(): void { $tester = new PrivateScopeTester(); $objectVars = $tester->getNewVars(TestScopePhp::class); @@ -297,7 +264,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyNewPhp() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotGetObjectVarsPrivatePropertyObjInternal() + public function testShouldNotGetObjectVarsPrivatePropertyObjInternal(): void { $tester = new PrivateScopeTester(); $object = new TestScopeExtending(); @@ -309,7 +276,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyObjInternal() /** * @see https://github.com/phalcon/zephir/issues/2057 */ - public function testShouldNotGetObjectVarsPrivatePropertyNewInternal() + public function testShouldNotGetObjectVarsPrivatePropertyNewInternal(): void { $tester = new PrivateScopeTester(); $objectVars = $tester->getNewVars(TestScopeExtending::class); @@ -320,9 +287,9 @@ public function testShouldNotGetObjectVarsPrivatePropertyNewInternal() /** * @see https://github.com/phalcon/zephir/issues/1851 */ - public function testShouldGetAndSetPrivatePropertyUsingParentGetterAndSetter() + public function testShouldGetAndSetPrivatePropertyUsingParentGetterAndSetter(): void { - $tester = new \UserExample(); + $tester = new UserExample(); $tester->setPrivateVariable('test'); $this->assertEquals('test', $tester->getPrivateVariable()); diff --git a/tests/Extension/OoTest.php b/tests/Extension/OoTest.php index 52e7cff2fc..8e7934b604 100644 --- a/tests/Extension/OoTest.php +++ b/tests/Extension/OoTest.php @@ -1,28 +1,35 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; use Stub\Oo; +use Stub\Oo\OoConstruct; +use Stub\Oo\OoConstructParams; +use Stub\Oo\OoDynamicA; +use Stub\Oo\OoDynamicB; +use Stub\Oo\OoNoConstruct; -class OoTest extends TestCase +final class OoTest extends TestCase { public function testAssertations(): void { - $test = new \Stub\Oo(); + $test = new Oo(); $this->assertEquals($test->testInstance1(), new \stdClass()); - $this->assertEquals($test->testInstance2(), new \Stub\Oo\OoConstruct()); - $this->assertEquals($test->testInstance3(), new \Stub\Oo\OoNoConstruct()); + $this->assertEquals($test->testInstance2(), new OoConstruct()); + $this->assertEquals($test->testInstance3(), new OoNoConstruct()); $obj4 = $test->testInstance4(); $this->assertIsObject($obj4); @@ -51,21 +58,15 @@ public function testAssertations(): void $obj9 = $test->testInstance9(); $this->assertIsObject($obj9); - $this->assertInstanceOf(\Stub\Oo\OoDynamicA::class, $obj9); + $this->assertInstanceOf(OoDynamicA::class, $obj9); $obj10 = $test->testInstance10(); $this->assertIsObject($obj10); - $this->assertInstanceOf(\Stub\Oo\OoDynamicB::class, $obj10); + $this->assertInstanceOf(OoDynamicB::class, $obj10); $obj = $test->testInstance11(); $this->assertIsObject($obj); - $this->assertInstanceOf(\Stub\Oo\OoConstructParams::class, $obj); - - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - /*$this->markTestIncomplete( - 'Not ready to run with PHP 8: interrupted by signal 11: SIGSEGV (Invalid callback , no array or string given)' - );*/ - } + $this->assertInstanceOf(OoConstructParams::class, $obj); $obj12 = $test->testInstance12(); $this->assertIsObject($obj12); diff --git a/tests/Extension/OperatorTest.php b/tests/Extension/OperatorTest.php index de7ff95cb8..f2aa06df6d 100644 --- a/tests/Extension/OperatorTest.php +++ b/tests/Extension/OperatorTest.php @@ -1,29 +1,31 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Operator; -class OperatorTest extends TestCase +final class OperatorTest extends TestCase { - /** @var \Stub\Operator */ - private $test; + private Operator $test; protected function setUp(): void { - $this->test = new \Stub\Operator(); + $this->test = new Operator(); } - public function test404Issue() + public function test404Issue(): void { $this->assertFalse($this->test->testIdentical(true, 1)); $this->assertFalse($this->test->testIdentical(true, 'phalcon')); @@ -34,7 +36,7 @@ public function test404Issue() $this->assertTrue($this->test->testIdentical('phalcon', 'phalcon')); } - public function test829Issue() + public function test829Issue(): void { $this->assertTrue($this->test->testIdenticalVarFalse(false)); $this->assertFalse($this->test->testIdenticalVarFalse(0)); @@ -44,14 +46,14 @@ public function test829Issue() $this->assertFalse($this->test->testIdenticalFalseVar('')); } - public function test1072Issue() + public function test1072Issue(): void { $this->assertFalse($this->test->testIdenticalIfComplex(false)); $this->assertTrue($this->test->testIdenticalIfComplex(0)); $this->assertTrue($this->test->testIdenticalIfComplex('')); } - public function test1279Issue() + public function test1279Issue(): void { $values = $this->test->testBoolComparison(true, false); diff --git a/tests/Extension/Optimizers/ArrayMergeTest.php b/tests/Extension/Optimizers/ArrayMergeTest.php index bfb0cd3d77..3af0f56308 100644 --- a/tests/Extension/Optimizers/ArrayMergeTest.php +++ b/tests/Extension/Optimizers/ArrayMergeTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Optimizers\ArrayMerge; -class ArrayMergeTest extends TestCase +final class ArrayMergeTest extends TestCase { - public function testTwoArrays() + public function testTwoArrays(): void { $this->assertSame([1, 2, 3, 4, 5], ArrayMerge::mergeTwoRequiredArrays([1, 2, 3], [4, 5])); $this->assertSame([1, 2, 3], ArrayMerge::mergeTwoRequiredArrays([1, 2, 3], [])); diff --git a/tests/Extension/Optimizers/CreateArrayTest.php b/tests/Extension/Optimizers/CreateArrayTest.php index 4f0d618f9c..0af4dd8bcc 100644 --- a/tests/Extension/Optimizers/CreateArrayTest.php +++ b/tests/Extension/Optimizers/CreateArrayTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -14,15 +16,15 @@ use PHPUnit\Framework\TestCase; use Stub\Optimizers\CreateArray; -class CreateArrayTest extends TestCase +final class CreateArrayTest extends TestCase { - public function testCreateArrayNoSize() + public function testCreateArrayNoSize(): void { $test = new CreateArray(); $this->assertSame(\count($test->createNoSize()), 0); } - public function testCreateArraySize() + public function testCreateArraySize(): void { $test = new CreateArray(); $this->assertSame(\count($test->createSize(3)), 3); diff --git a/tests/Extension/Optimizers/IsPhpVersionTest.php b/tests/Extension/Optimizers/IsPhpVersionTest.php index 1039cf5b73..435bf6b889 100644 --- a/tests/Extension/Optimizers/IsPhpVersionTest.php +++ b/tests/Extension/Optimizers/IsPhpVersionTest.php @@ -1,6 +1,6 @@ @@ -11,15 +11,17 @@ namespace Extension\Optimizers; +use Exception; use PHPUnit\Framework\TestCase; use Stub\Issue1404; +use Throwable; /** * Extension\Optimizers\IsPhpVersionTest. * * @issue https://github.com/phalcon/zephir/issues/1404 */ -class IsPhpVersionTest extends TestCase +final class IsPhpVersionTest extends TestCase { const PHP_RELEASES_LIMIT = 17; const PHP_MINOR_LIMIT = 3; @@ -36,7 +38,7 @@ protected function tearDown(): void $this->test = null; } - public function phpVersionProvider() + public function phpVersionProvider(): array { return [ [PHP_VERSION, true], @@ -58,8 +60,9 @@ public function phpVersionProvider() * * @param mixed $version * @param mixed $expected + * @throws Exception */ - public function testOptimizer($version, $expected) + public function testOptimizer($version, $expected): void { $isPhpVersion = (bool) $this->isPhpVersion($version); @@ -68,7 +71,7 @@ public function testOptimizer($version, $expected) public function testOptimizerExceptionLLU(): void { - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('Could not parse PHP version'); $this->isPhpVersion(92233720368547758079); @@ -76,7 +79,7 @@ public function testOptimizerExceptionLLU(): void public function testOptimizerExceptionNegativeNumber(): void { - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('Could not parse PHP version'); $this->isPhpVersion(-7); @@ -84,14 +87,13 @@ public function testOptimizerExceptionNegativeNumber(): void public function testOptimizerExceptionNull(): void { - $this->expectException(\Exception::class); + $this->expectException(Exception::class); $this->expectExceptionMessage('Could not parse PHP version'); $this->isPhpVersion(null); } - /* -------------- Zephir Tests -------------- */ - public function testZephirUsingInteger70000() + public function testZephirUsingInteger70000(): void { $actual = $this->test->testIsPhpVersionUsingInteger70000(); $expected = $this->isPhpVersion(7); @@ -99,7 +101,7 @@ public function testZephirUsingInteger70000() $this->assertEquals($expected, $actual); } - public function testZephirUsingDouble70100() + public function testZephirUsingDouble70100(): void { $actual = $this->test->testIsPhpVersionUsingDouble70100(); $expected = $this->isPhpVersion(7.1); @@ -107,7 +109,7 @@ public function testZephirUsingDouble70100() $this->assertEquals($expected, $actual); } - public function testZephirUsingLong70000() + public function testZephirUsingLong70000(): void { $actual = $this->test->testIsPhpVersionUsingLong70000(); $expected = $this->isPhpVersion(2147483647); @@ -115,12 +117,12 @@ public function testZephirUsingLong70000() $this->assertEquals($expected, $actual); } - public function testZephirUsingZeroFalse() + public function testZephirUsingZeroFalse(): void { $this->assertFalse($this->test->testIsPhpVersionUsingZero()); } - public function testZephirUsingString70000() + public function testZephirUsingString70000(): void { $actual = $this->test->testIsPhpVersionUsingString70000(); $expected = $this->isPhpVersion('7'); @@ -128,7 +130,7 @@ public function testZephirUsingString70000() $this->assertEquals($expected, $actual); } - public function releaseVersionProvider() + public function releaseVersionProvider(): array { $versionProvider = []; @@ -144,8 +146,9 @@ public function releaseVersionProvider() * * @param mixed $testName * @param mixed $version + * @throws Exception */ - public function testIsPhpVersionVersionUsing701XX($testName, $version) + public function testIsPhpVersionVersionUsing701XX($testName, $version): void { $actual = $this->test->$testName(); $expected = $this->isPhpVersion($version); @@ -153,7 +156,7 @@ public function testIsPhpVersionVersionUsing701XX($testName, $version) $this->assertEquals($expected, $actual); } - public function minorVersionProvider() + public function minorVersionProvider(): array { $versionProvider = []; @@ -169,8 +172,9 @@ public function minorVersionProvider() * * @param mixed $testName * @param mixed $version + * @throws Exception */ - public function testIsPhpVersionVersionUsing70X00($testName, $version) + public function testIsPhpVersionVersionUsing70X00($testName, $version): void { $actual = $this->test->$testName(); $expected = $this->isPhpVersion($version); @@ -178,7 +182,7 @@ public function testIsPhpVersionVersionUsing70X00($testName, $version) $this->assertEquals($expected, $actual); } - public function testZephirUsingString50000() + public function testZephirUsingString50000(): void { $actual = $this->test->testIsPhpVersionUsing50000(); $expected = $this->isPhpVersion('5'); @@ -186,7 +190,7 @@ public function testZephirUsingString50000() $this->assertEquals($expected, $actual); } - public function testZephirUsingString50500() + public function testZephirUsingString50500(): void { $actual = $this->test->testIsPhpVersionUsing50500(); $expected = $this->isPhpVersion('5.5'); @@ -194,7 +198,7 @@ public function testZephirUsingString50500() $this->assertEquals($expected, $actual); } - public function testZephirUsingString50600() + public function testZephirUsingString50600(): void { $actual = $this->test->testIsPhpVersionUsing50600(); $expected = $this->isPhpVersion('5.6'); @@ -203,13 +207,10 @@ public function testZephirUsingString50600() } /** - * {@inheritdoc} - * - * @param \Throwable $error - * - * @throws \Throwable + * @param Throwable $error + * @throws Throwable */ - protected function onNotSuccessfulTest(\Throwable $error): void + protected function onNotSuccessfulTest(Throwable $error): void { $phpVer = sprintf( 'PHP_VERSION_ID:%d(%d.%d.%d)', @@ -232,15 +233,15 @@ protected function onNotSuccessfulTest(\Throwable $error): void * @param float|int|string $version - PHP version in any format: 7, 7.1, "7.1.1" * * @return bool + * @throws Exception */ - private function isPhpVersion($version) + private function isPhpVersion($version): bool { preg_match('/^(?\d+)(?:\.(?!?\d+))?(?:\.(?!?\d+))?(?:[^Ee0-9.]+.*)?$/', $version, $matches); if (!\count($matches)) { - throw new \Exception('Could not parse PHP version'); + throw new Exception('Could not parse PHP version'); } - $majorVersion = 0; $minorVersion = 0; $releaseVersion = 0; @@ -263,6 +264,6 @@ private function isPhpVersion($version) $versionId = (int) ($majorVersion + $minorVersion + $releaseVersion); $phpVersionId = $phpMajorVersion + $phpMinorVersion + $phpReleaseVersion; - return (bool) ($phpVersionId == $versionId ? 1 : 0); + return $phpVersionId === $versionId; } } diff --git a/tests/Extension/Optimizers/IsScalarTest.php b/tests/Extension/Optimizers/IsScalarTest.php index 71eed4c7c7..d2b7ce0fb8 100644 --- a/tests/Extension/Optimizers/IsScalarTest.php +++ b/tests/Extension/Optimizers/IsScalarTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\Optimizers\IsScalar; -class IsScalarTest extends TestCase +final class IsScalarTest extends TestCase { - /** @var IsScalar */ - private $test; + private IsScalar $test; protected function setUp(): void { $this->test = new IsScalar(); } - public function testVariable() + public function testVariable(): void { $this->assertTrue($this->test->testIntVar()); $this->assertTrue($this->test->testDoubleVar()); @@ -35,7 +36,7 @@ public function testVariable() $this->assertFalse($this->test->testEmptyArrayVar()); } - public function testVariableParameter() + public function testVariableParameter(): void { $this->assertTrue($this->test->testVarParameter(1)); $this->assertTrue($this->test->testVarParameter(1.0)); diff --git a/tests/Extension/Optimizers/MathTest.php b/tests/Extension/Optimizers/MathTest.php index ce529ac005..5125a50ae3 100644 --- a/tests/Extension/Optimizers/MathTest.php +++ b/tests/Extension/Optimizers/MathTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -20,9 +22,9 @@ use Stub\Optimizers\Sqrt; use Stub\Optimizers\Tan; -class MathTest extends TestCase +final class MathTest extends TestCase { - public function testLdexp() + public function testLdexp(): void { $test = new Ldexp(); @@ -35,7 +37,7 @@ public function testLdexp() $this->assertSame(524288.0, $test->testvarParameter(8, 16)); } - public function testSqrt() + public function testSqrt(): void { $test = new Sqrt(); @@ -52,7 +54,7 @@ public function testSqrt() $this->assertSame(4.0, $test->testVarParameter(16)); } - public function testSin() + public function testSin(): void { $test = new Sin(); @@ -69,7 +71,7 @@ public function testSin() $this->assertSame(sin(16), $test->testVarParameter(16)); } - public function testCos() + public function testCos(): void { $test = new Cos(); @@ -86,7 +88,7 @@ public function testCos() $this->assertSame(cos(16), $test->testVarParameter(16)); } - public function testACos() + public function testACos(): void { $test = new ACos(); @@ -102,7 +104,7 @@ public function testACos() $this->assertSame(acos(0), $test->testVarParameter(0)); } - public function testASin() + public function testASin(): void { $test = new ASin(); @@ -118,7 +120,7 @@ public function testASin() $this->assertSame(asin(0), $test->testVarParameter(0)); } - public function testTan() + public function testTan(): void { $test = new Tan(); diff --git a/tests/Extension/Optimizers/StrReplaceTest.php b/tests/Extension/Optimizers/StrReplaceTest.php index c80ef95cf2..355b481d42 100644 --- a/tests/Extension/Optimizers/StrReplaceTest.php +++ b/tests/Extension/Optimizers/StrReplaceTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -14,19 +16,19 @@ use PHPUnit\Framework\TestCase; use Stub\Optimizers\StrReplace; -class StrReplaceTest extends TestCase +final class StrReplaceTest extends TestCase { - public function testIssue1055() + public function testIssue1055(): void { $this->assertSame(StrReplace::issue1055(), 'bla bla aaa aaaa askks'); } - public function issue1087() + public function issue1087(): void { $this->assertSame(StrReplace::issue1087(), 'test_test'); } - public function issue732() + public function issue732(): void { $this->assertSame(StrReplace::issue732A(), 'F'); $this->assertSame(StrReplace::issue732B(), 'The slow black bear jumped over the lazy dog.'); diff --git a/tests/Extension/Optimizers/SubstrTest.php b/tests/Extension/Optimizers/SubstrTest.php index 5be8be6e85..18c90a75dc 100644 --- a/tests/Extension/Optimizers/SubstrTest.php +++ b/tests/Extension/Optimizers/SubstrTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Optimizers; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Optimizers\Substr; -class SubstrTest extends TestCase +final class SubstrTest extends TestCase { - public function testTwoArguments1() + public function testTwoArguments1(): void { $test = new Substr(); @@ -34,7 +36,7 @@ public function testTwoArguments1() } } - public function testThreeArguments1() + public function testThreeArguments1(): void { $test = new Substr(); $this->assertSame($test->testThreeArguments('abcdef', 0, -3), 'abc'); diff --git a/tests/Extension/PregmatchTest.php b/tests/Extension/PregmatchTest.php index fffd0652ea..58676fc8e9 100644 --- a/tests/Extension/PregmatchTest.php +++ b/tests/Extension/PregmatchTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,77 +16,37 @@ use PHPUnit\Framework\TestCase; use Stub\Pregmatch; -class PregmatchTest extends TestCase +final class PregmatchTest extends TestCase { - /** @var Pregmatch */ - private $test; + private Pregmatch $test; protected function setUp(): void { $this->test = new Pregmatch(); } - public function testPregMatch() + public function testPregMatch(): void { $this->assertSame(1, $this->test->testWithoutReturnAndMatches()); $this->assertSame(['def'], $this->test->testWithoutReturns()); $this->assertSame(1, $this->test->testWithoutMatches()); $this->assertSame(1, $this->test->testPregMatchAll()); $this->assertSame(1, $this->test->testPregMatchFallback()); - - // more tests from php5 ext/pcre - - // TODO: Implement References (reference for parameters in this case) - // without references it's not possible to get the "matches" value out of the scope - // of the test function, since it's passed by value to testPregMatch3Params for example - // and any value remains only in the scope of the test function - - if (version_compare(PHP_VERSION, '7.0', '<')) { - $string = 'Hello, world. [*], this is \ a string'; - $match1 = null; - $this->assertSame(1, $this->test->testPregMatch3Params('/^[hH]ello,\s/', $string, $match1)); //finds "Hello, " - $this->assertSame('Hello, ', $match1[0]); - - $match2 = null; - $this->assertSame(0, $this->test->testPregMatch4Params('/l^o,\s\w{5}/', $string, $match2, PREG_OFFSET_CAPTURE)); // tries to find "lo, world" at start of string - $this->assertCount(0, $match2); - - $match3 = null; - $this->assertSame(1, $this->test->testPregMatch3Params('/\[\*\],\s(.*)/', $string, $match3)); //finds "[*], this is \ a string"; - $this->assertCount(2, $match3); - - $match4 = null; - $this->assertSame(1, $this->test->testPregMatch5Params('@\w{4}\s\w{2}\s\\\(?:\s.*)@', $string, $match4, PREG_OFFSET_CAPTURE, 14)); //finds "this is \ a string" (with non-capturing parentheses) - /* - * TODO: didn`this->test pass at local machine - */ - $this->assertSame('this is \ a string', $match4[0][0]); - - $match5 = null; - $this->assertSame(0, $this->test->testPregMatch3Params('/hello world/', $string, $match5)); //tries to find "hello world" (should be Hello, world) - $this->assertCount(0, $match5); - - $string2 = "My\nName\nIs\nStrange"; - $match6 = null; - $this->assertSame(1, $this->test->testPregMatch3Params('/M(.*)/', $string2, $match6)); - $this->assertCount(2, $match6); - } - $this->assertSame(1, $this->test->testPregMatch2Params('#asd#', 'asd')); } /** - * @see https://github.com/phalcon/zephir/issues/287 + * @issue https://github.com/phalcon/zephir/issues/287 */ - public function testCollectMatches() + public function testCollectMatches(): void { $this->assertSame(['asd'], $this->test->testPregMatchSaveMatches('asd', '#asd#')); } /** - * @see https://github.com/phalcon/zephir/issues/144 + * @issue https://github.com/phalcon/zephir/issues/144 */ - public function testPregMatchAllFlags() + public function testPregMatchAllFlags(): void { $arr = $this->test->testMatchAllInZep(); $this->assertSame($arr[0], [['test1', 'test2'], ['test1', 'test2']]); diff --git a/tests/Extension/Properties/PrivatePropertiesTest.php b/tests/Extension/Properties/PrivatePropertiesTest.php index a15e5dbbbc..c218982d24 100644 --- a/tests/Extension/Properties/PrivatePropertiesTest.php +++ b/tests/Extension/Properties/PrivatePropertiesTest.php @@ -1,6 +1,8 @@ @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Properties\PrivateProperties; -class PrivatePropertiesTest extends TestCase +final class PrivatePropertiesTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { $test = new PrivateProperties(); diff --git a/tests/Extension/Properties/PropertyArrayTest.php b/tests/Extension/Properties/PropertyArrayTest.php index a5fca32b79..c60f6399b9 100644 --- a/tests/Extension/Properties/PropertyArrayTest.php +++ b/tests/Extension/Properties/PropertyArrayTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Properties\PropertyArray; -class PropertyArrayTest extends TestCase +final class PropertyArrayTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { $test = new PropertyArray(); $this->assertSame([1], $test->someArray); @@ -24,7 +26,7 @@ public function testAssertations() $this->assertSame([1, 'one'], $test->someArray); } - public function testIssues1831() + public function testIssues1831(): void { $header = [ 'header 1', diff --git a/tests/Extension/Properties/PropertyUpdateTest.php b/tests/Extension/Properties/PropertyUpdateTest.php index da7a5c9c0f..1cb5ac4448 100644 --- a/tests/Extension/Properties/PropertyUpdateTest.php +++ b/tests/Extension/Properties/PropertyUpdateTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; @@ -14,7 +16,7 @@ use PHPUnit\Framework\TestCase; use Stub\Properties\PropertyUpdate; -class PropertyUpdateTest extends TestCase +final class PropertyUpdateTest extends TestCase { public function testUpdate11() { diff --git a/tests/Extension/Properties/ProtectedPropertiesTest.php b/tests/Extension/Properties/ProtectedPropertiesTest.php index 19e86cfe91..98e1c1ddfa 100644 --- a/tests/Extension/Properties/ProtectedPropertiesTest.php +++ b/tests/Extension/Properties/ProtectedPropertiesTest.php @@ -1,6 +1,8 @@ @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Properties\ProtectedProperties; -class ProtectedPropertiesTest extends TestCase +final class ProtectedPropertiesTest extends TestCase { - public function testShouldGetDefaultValueOfProtectedPropertiesUsingGetters() + public function testShouldGetDefaultValueOfProtectedPropertiesUsingGetters(): void { $test = new ProtectedProperties(); @@ -32,7 +34,7 @@ public function testShouldGetDefaultValueOfProtectedPropertiesUsingGetters() $this->assertEquals('test', $test->getSomeString()); } - public function testShouldSetAndGetProtectedPropertyUsingShortcuts() + public function testShouldSetAndGetProtectedPropertyUsingShortcuts(): void { $test = new ProtectedProperties(); @@ -43,9 +45,9 @@ public function testShouldSetAndGetProtectedPropertyUsingShortcuts() } /** - * @see https://github.com/phalcon/zephir/issues/2089 + * @issue https://github.com/phalcon/zephir/issues/2089 */ - public function testShouldSetAndGetProtectedPropertyUsingExtendedClass() + public function testShouldSetAndGetProtectedPropertyUsingExtendedClass(): void { $test = new \ExtendsProtectedProperties(); diff --git a/tests/Extension/Properties/PublicPropertiesTest.php b/tests/Extension/Properties/PublicPropertiesTest.php index 8af5e13e2f..0e8261a488 100644 --- a/tests/Extension/Properties/PublicPropertiesTest.php +++ b/tests/Extension/Properties/PublicPropertiesTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; @@ -15,9 +17,9 @@ use Stub\Properties\ExtendsPublicProperties; use Stub\Properties\PublicProperties; -class PublicPropertiesTest extends TestCase +final class PublicPropertiesTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { $test = new PublicProperties(); @@ -33,16 +35,16 @@ public function testAssertations() $this->assertSame([1, 2, 3, 4], $test->someArray); } - public function test394Issue() + public function test394Issue(): void { $test = new PublicProperties(); $this->assertTrue($test->test394Issue()); } /** - * @see https://github.com/phalcon/zephir/issues/537 + * @issue https://github.com/phalcon/zephir/issues/537 */ - public function test537Issue() + public function test537Issue(): void { $test = new ExtendsPublicProperties(); $this->assertSame($test->getSomeGetterSetterArray(), ['holy']); diff --git a/tests/Extension/Properties/StaticPrivatePropertiesTest.php b/tests/Extension/Properties/StaticPrivatePropertiesTest.php index c8e8da7bf0..56c10861fb 100644 --- a/tests/Extension/Properties/StaticPrivatePropertiesTest.php +++ b/tests/Extension/Properties/StaticPrivatePropertiesTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; @@ -15,12 +17,12 @@ use Stub\Properties\App; use Stub\Properties\StaticPrivateProperties; -class StaticPrivatePropertiesTest extends TestCase +final class StaticPrivatePropertiesTest extends TestCase { /** * @issue https://github.com/phalcon/zephir/issues/1530 */ - public function testShouldGetInstanceByUsingSingleton() + public function testShouldGetInstanceByUsingSingleton(): void { $test = new App(); diff --git a/tests/Extension/Properties/StaticPropertyArrayTest.php b/tests/Extension/Properties/StaticPropertyArrayTest.php index d5dc0082f0..b2cce1930d 100644 --- a/tests/Extension/Properties/StaticPropertyArrayTest.php +++ b/tests/Extension/Properties/StaticPropertyArrayTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Properties\StaticPropertyArray; -class StaticPropertyArrayTest extends TestCase +final class StaticPropertyArrayTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { $this->assertSame([], StaticPropertyArray::$someEmptyArray); $this->assertSame([1, 2, 3, 4], StaticPropertyArray::$someArray); diff --git a/tests/Extension/Properties/StaticPublicPropertiesTest.php b/tests/Extension/Properties/StaticPublicPropertiesTest.php index 56fb8b11a4..30413390ec 100644 --- a/tests/Extension/Properties/StaticPublicPropertiesTest.php +++ b/tests/Extension/Properties/StaticPublicPropertiesTest.php @@ -1,65 +1,68 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\Properties; use PHPUnit\Framework\TestCase; +use Stub\Properties\StaticPublicProperties; -class StaticPublicPropertiesTest extends TestCase +final class StaticPublicPropertiesTest extends TestCase { - public function testAssertations() + public function testAssertations(): void { - $this->assertNull(\Stub\Properties\StaticPublicProperties::$someNull); - $this->assertNull(\Stub\Properties\StaticPublicProperties::$someNullInitial); - $this->assertFalse(\Stub\Properties\StaticPublicProperties::$someFalse); - $this->assertTrue(\Stub\Properties\StaticPublicProperties::$someTrue); - $this->assertSame(\Stub\Properties\StaticPublicProperties::$someInteger, 10); - $this->assertSame(\Stub\Properties\StaticPublicProperties::$someDouble, 10.25); - $this->assertSame(\Stub\Properties\StaticPublicProperties::$someString, 'test'); + $this->assertNull(StaticPublicProperties::$someNull); + $this->assertNull(StaticPublicProperties::$someNullInitial); + $this->assertFalse(StaticPublicProperties::$someFalse); + $this->assertTrue(StaticPublicProperties::$someTrue); + $this->assertSame(StaticPublicProperties::$someInteger, 10); + $this->assertSame(StaticPublicProperties::$someDouble, 10.25); + $this->assertSame(StaticPublicProperties::$someString, 'test'); } - public function testIssues1904() + public function testIssues1904(): void { - $value = &\Stub\Properties\StaticPublicProperties::$someString; + $value = &StaticPublicProperties::$someString; $value = 'test1'; - $this->assertSame(\Stub\Properties\StaticPublicProperties::$someString, $value); - \Stub\Properties\StaticPublicProperties::$someString = 'test2'; - $this->assertSame(\Stub\Properties\StaticPublicProperties::$someString, $value); + $this->assertSame(StaticPublicProperties::$someString, $value); + StaticPublicProperties::$someString = 'test2'; + $this->assertSame(StaticPublicProperties::$someString, $value); // Disabled due to: // https://github.com/phalcon/zephir/issues/1941#issuecomment-538654340 - // \Stub\Properties\StaticPublicProperties::setSomeString('test3'); - // $this->assertSame(\Stub\Properties\StaticPublicProperties::$someString, $value); + StaticPublicProperties::setSomeString('test3'); + $this->assertSame(StaticPublicProperties::$someString, $value); } - public function testIssues2020() + public function testIssues2020(): void { - \Stub\Properties\StaticPublicProperties::testAddAndSub(); - $this->assertEquals(1, \Stub\Properties\StaticPublicProperties::$someAdd); - $this->assertEquals(-1, \Stub\Properties\StaticPublicProperties::$someSub); + StaticPublicProperties::testAddAndSub(); + $this->assertEquals(1, StaticPublicProperties::$someAdd); + $this->assertEquals(-1, StaticPublicProperties::$someSub); // PHP Notice: A non well formed numeric value encountered //\Stub\Properties\StaticPublicProperties::testAddAndSub2(); //$this->assertEquals(2, \Stub\Properties\StaticPublicProperties::$someAdd); //$this->assertEquals(-2, \Stub\Properties\StaticPublicProperties::$someSub); - \Stub\Properties\StaticPublicProperties::testAddAndSub3(); - $this->assertEquals(2, \Stub\Properties\StaticPublicProperties::$someAdd); - $this->assertEquals(-2, \Stub\Properties\StaticPublicProperties::$someSub); + StaticPublicProperties::testAddAndSub3(); + $this->assertEquals(2, StaticPublicProperties::$someAdd); + $this->assertEquals(-2, StaticPublicProperties::$someSub); - \Stub\Properties\StaticPublicProperties::testAddAndSub4(); - $this->assertEquals(3, \Stub\Properties\StaticPublicProperties::$someAdd); - $this->assertEquals(-3, \Stub\Properties\StaticPublicProperties::$someSub); + StaticPublicProperties::testAddAndSub4(); + $this->assertEquals(3, StaticPublicProperties::$someAdd); + $this->assertEquals(-3, StaticPublicProperties::$someSub); - \Stub\Properties\StaticPublicProperties::testAddAndSub4(); - $this->assertEquals(4, \Stub\Properties\StaticPublicProperties::$someAdd); - $this->assertEquals(-4, \Stub\Properties\StaticPublicProperties::$someSub); + StaticPublicProperties::testAddAndSub4(); + $this->assertEquals(4, StaticPublicProperties::$someAdd); + $this->assertEquals(-4, StaticPublicProperties::$someSub); } } diff --git a/tests/Extension/RequiresTest.php b/tests/Extension/RequiresTest.php index dd1307ed70..8a7d23f605 100644 --- a/tests/Extension/RequiresTest.php +++ b/tests/Extension/RequiresTest.php @@ -1,6 +1,8 @@ @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\Requires; -class RequiresTest extends TestCase +final class RequiresTest extends TestCase { - /** @var Requires */ - private $test; + private Requires $test; protected function setUp(): void { $this->test = new Requires(); } - public function testRequireExternal1() + public function testRequireExternal1(): void { $this->assertSame( [1, 2, 3], @@ -39,7 +40,7 @@ public function testRequireExternal1() /** * @issue https://github.com/phalcon/zephir/pull/1428 */ - public function testShouldRequireUsingNewSymbolTable() + public function testShouldRequireUsingNewSymbolTable(): void { ob_start(); $actual = $this->test->requireExternal3(__DIR__.'/../fixtures/require-me-3.php'); @@ -51,7 +52,7 @@ public function testShouldRequireUsingNewSymbolTable() /** * @issue https://github.com/phalcon/zephir/issues/1621 */ - public function testShouldRenderTemplate() + public function testShouldRenderTemplate(): void { $param = 1; @@ -66,7 +67,7 @@ public function testShouldRenderTemplate() /** * @issue https://github.com/phalcon/zephir/issues/1713 */ - public function testShouldRequirePhar() + public function testShouldRequirePhar(): void { $this->assertEquals( "I'm in", diff --git a/tests/Extension/ResourceTest.php b/tests/Extension/ResourceTest.php index 6bb7f21719..b7bf78b617 100644 --- a/tests/Extension/ResourceTest.php +++ b/tests/Extension/ResourceTest.php @@ -1,22 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class ResourceTest extends TestCase +final class ResourceTest extends TestCase { - /** @var \Stub\ResourceTest */ - private $test; + private \Stub\ResourceTest $test; protected function setUp(): void { diff --git a/tests/Extension/ReturnsTest.php b/tests/Extension/ReturnsTest.php index dc422ee472..087e4f6925 100644 --- a/tests/Extension/ReturnsTest.php +++ b/tests/Extension/ReturnsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,12 +16,12 @@ use PHPUnit\Framework\TestCase; use Stub\Returns; -class ReturnsTest extends TestCase +final class ReturnsTest extends TestCase { /** * @issue https://github.com/phalcon/zephir/issues/1534 */ - public function testShouldReturnWithParameter() + public function testShouldReturnWithParameter(): void { $tester = new Returns(); $this->assertSame('Return back', $tester->returnWithParameter('Hello World!')); @@ -28,7 +30,7 @@ public function testShouldReturnWithParameter() /** * @issue https://github.com/phalcon/zephir/issues/1534 */ - public function testShouldReturnWithParameterStaticVersion() + public function testShouldReturnWithParameterStaticVersion(): void { $this->assertSame('Return back', Returns::returnWithParameter('Hello World!')); } @@ -36,7 +38,7 @@ public function testShouldReturnWithParameterStaticVersion() /** * @issue https://github.com/phalcon/zephir/issues/1534 */ - public function testShouldReturnWithoutParameter() + public function testShouldReturnWithoutParameter(): void { $tester = new Returns(); $this->assertSame('Return back', $tester->returnWithoutParameter()); @@ -45,7 +47,7 @@ public function testShouldReturnWithoutParameter() /** * @issue https://github.com/phalcon/zephir/issues/1534 */ - public function testShouldReturnWithoutParameterStaticVersion() + public function testShouldReturnWithoutParameterStaticVersion(): void { $this->assertSame('Return back', Returns::returnWithoutParameter()); } diff --git a/tests/Extension/RouterTest.php b/tests/Extension/RouterTest.php index 10804df01d..bfa2527c84 100644 --- a/tests/Extension/RouterTest.php +++ b/tests/Extension/RouterTest.php @@ -1,21 +1,24 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Router; -class RouterTest extends TestCase +final class RouterTest extends TestCase { - public function testRouter() + public function testRouter(): void { $tests = [ [ @@ -122,7 +125,7 @@ public function testRouter() ], ]; - $router = new \Stub\Router(); + $router = new Router(); $router->add('/', [ 'controller' => 'index', @@ -174,11 +177,8 @@ public function testRouter() ]); $router->add("/feed/{lang:[a-z]+}/blog/{blog:[a-z\-]+}\.{type:[a-z\-]+}", 'Feed::get'); - $router->add("/posts/{year:[0-9]+}/s/{title:[a-z\-]+}", 'Posts::show'); - $router->add('/posts/delete/{id}', 'Posts::delete'); - $router->add("/show/{id:video([0-9]+)}/{title:[a-z\-]+}", 'Videos::show'); foreach ($tests as $n => $test) { diff --git a/tests/Extension/SPropertyAccessTest.php b/tests/Extension/SPropertyAccessTest.php index 3f03905dc3..929a1fafe9 100644 --- a/tests/Extension/SPropertyAccessTest.php +++ b/tests/Extension/SPropertyAccessTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,23 +16,23 @@ use PHPUnit\Framework\TestCase; use Stub\SPropertyAccess; -class SPropertyAccessTest extends TestCase +final class SPropertyAccessTest extends TestCase { - public function testStaticPropertyAccess() + public function testStaticPropertyAccess(): void { $spa = new SPropertyAccess(); $this->assertSame($spa->testArgument(','), ','); $this->assertSame($spa->testArgument(), '.'); } - public function testStaticPropertyAccessWithUnderscore() + public function testStaticPropertyAccessWithUnderscore(): void { $spa = new SPropertyAccess(); $this->assertSame($spa->testArgumentWithUnderscore(','), ','); $this->assertSame($spa->testArgumentWithUnderscore(), '.'); } - public function testShouldMutateStringVarInsideCycle() + public function testShouldMutateStringVarInsideCycle(): void { $this->assertEquals( str_repeat(' + ', 4), @@ -39,9 +41,9 @@ public function testShouldMutateStringVarInsideCycle() } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @issue https://github.com/phalcon/zephir/issues/1494 */ - public function testShouldMutateIntVarInsideCycle() + public function testShouldMutateIntVarInsideCycle(): void { $this->assertEquals( 42, @@ -50,9 +52,9 @@ public function testShouldMutateIntVarInsideCycle() } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @issue https://github.com/phalcon/zephir/issues/1494 */ - public function testShouldMutateDoubleVarInsideCycle() + public function testShouldMutateDoubleVarInsideCycle(): void { $this->assertEquals( 3.14, @@ -60,7 +62,7 @@ public function testShouldMutateDoubleVarInsideCycle() ); } - public function testShouldMutateArrayVarInsideCycle() + public function testShouldMutateArrayVarInsideCycle(): void { $this->assertEquals( [0, 1, 2, 3], diff --git a/tests/Extension/ScallExternalTest.php b/tests/Extension/ScallExternalTest.php index a5d5559b58..e4602a948e 100644 --- a/tests/Extension/ScallExternalTest.php +++ b/tests/Extension/ScallExternalTest.php @@ -1,29 +1,32 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\ScallExternal; -class ScallExternalTest extends TestCase +final class ScallExternalTest extends TestCase { - public function testCall1() + public function testCall1(): void { - $test = new \Stub\ScallExternal(); + $test = new ScallExternal(); $this->assertSame($test->testCall1(), 'hello public'); } - public function testCall2() + public function testCall2(): void { - $test = new \Stub\ScallExternal(); + $test = new ScallExternal(); $this->assertSame($test->testCall2(2, 3), 5); } } diff --git a/tests/Extension/ScallLateConstructTest.php b/tests/Extension/ScallLateConstructTest.php index 025201ef23..715fe3ffdf 100644 --- a/tests/Extension/ScallLateConstructTest.php +++ b/tests/Extension/ScallLateConstructTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,17 +16,13 @@ use PHPUnit\Framework\TestCase; use Stub\ScallLateConstruct; -class ScallLateConstructTest extends TestCase +final class ScallLateConstructTest extends TestCase { /** - * @see https://github.com/phalcon/zephir/issues/2111 + * @issue https://github.com/phalcon/zephir/issues/2111 */ - public function testConstruct() + public function testConstruct(): void { - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - //$this->markTestSkipped('Should be fixed static call before run this test (Invalid callback , no array or string given)'); - } - $test = new ScallLateConstruct(); $this->assertSame('hello public', $test->varValue()); } diff --git a/tests/Extension/ScallTest.php b/tests/Extension/ScallTest.php index 9f12f041a6..e3cad0a528 100644 --- a/tests/Extension/ScallTest.php +++ b/tests/Extension/ScallTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -15,14 +17,10 @@ use Stub\Scall; use Stub\Scallparent; -class ScallTest extends TestCase +final class ScallTest extends TestCase { - public function testScall() + public function testScall(): void { - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - //$this->markTestSkipped('Should be fixed static call before run this test (Invalid callback , no array or string given)'); - } - $test = new Scall(); $this->assertSame('hello public', $test->testMethod1()); @@ -53,18 +51,18 @@ public function testScall() } /** - * @see https://github.com/phalcon/zephir/issues/1622 + * @issue https://github.com/phalcon/zephir/issues/1622 */ - public function testShouldReturnInterpolatedMethodFromZephir() + public function testShouldReturnInterpolatedMethodFromZephir(): void { $test = new Scall(); $this->assertSame('hello Scall', $test->interpolatedStaticReturn()); } /** - * @see https://github.com/phalcon/zephir/issues/1622 + * @issue https://github.com/phalcon/zephir/issues/1622 */ - public function testShouldEchoInterpolatedMethodFromZephir() + public function testShouldEchoInterpolatedMethodFromZephir(): void { $test = new Scall(); diff --git a/tests/Extension/ScopeTest.php b/tests/Extension/ScopeTest.php index 28e1fbeb25..6923992df6 100644 --- a/tests/Extension/ScopeTest.php +++ b/tests/Extension/ScopeTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,16 +16,10 @@ use PHPUnit\Framework\TestCase; use Stub\Scope; -class ScopeTest extends TestCase +final class ScopeTest extends TestCase { - public function testScope1() + public function testScope1(): void { - if (version_compare(PHP_VERSION, '8.0.0', '>=')) { - /*$this->markTestIncomplete( - 'Not ready to run with PHP 8: interrupted by signal 11: SIGSEGV' - );*/ - } - $this->assertSame(Scope::test1(), 'testinternal_string'); $this->assertSame(Scope::test2(), [15, '0_66_132_198_']); $this->assertSame(Scope::test3(), 'internal_0internal_1internal_2internal_3'); diff --git a/tests/Extension/StatementsTest.php b/tests/Extension/StatementsTest.php index caef3c90a2..737bcc88b8 100644 --- a/tests/Extension/StatementsTest.php +++ b/tests/Extension/StatementsTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Stub\Statements; -class StatementsTest extends TestCase +final class StatementsTest extends TestCase { - /** @var Statements */ - private $test; + private Statements $test; protected function setUp(): void { $this->test = new Statements(); } - public function testElseIf() + public function testElseIf(): void { $this->assertSame('more', $this->test->testElseIf(10)); $this->assertSame('equal', $this->test->testElseIf(0)); @@ -32,21 +33,21 @@ public function testElseIf() $this->assertSame('less', $this->test->testElseIf(-10)); } - public function testElseIf1() + public function testElseIf1(): void { $this->assertSame('equal', $this->test->testElseIf1(10)); $this->assertSame('less', $this->test->testElseIf1(5)); $this->assertSame('else', $this->test->testElseIf1(11)); } - public function testElseIf2() + public function testElseIf2(): void { $this->assertSame('equal', $this->test->testElseIf2(10, 10)); $this->assertSame('less', $this->test->testElseIf2(5, 10)); $this->assertSame('else', $this->test->testElseIf2(11, 10)); } - public function test544Issue() + public function test544Issue(): void { $this->assertSame('====>...............................................................................................', $this->test->test544Issue(5)); $this->assertSame('====================================================================================================', $this->test->test544Issue(100)); diff --git a/tests/Extension/StringTest.php b/tests/Extension/StringTest.php index 6707e509a9..837ba83b89 100644 --- a/tests/Extension/StringTest.php +++ b/tests/Extension/StringTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,10 +16,9 @@ use PHPUnit\Framework\TestCase; use Stub\Strings; -class StringTest extends TestCase +final class StringTest extends TestCase { - /** @var Strings */ - private $test; + private Strings $test; protected function setUp(): void { @@ -31,7 +32,7 @@ protected function setUp(): void * @param mixed $userString * @param mixed $expected */ - public function testHashEquals($knownString, $userString, $expected) + public function testHashEquals($knownString, $userString, $expected): void { $salt = '$2a$07$usesomesillystringforsalt$'; $knownString = crypt($knownString, $salt); @@ -43,10 +44,10 @@ public function testHashEquals($knownString, $userString, $expected) /** * @dataProvider providerHashEqualsNonString * - * @param string $knownString - * @param string $userString + * @param mixed $knownString + * @param mixed $userString */ - public function testHashEqualsNonString($knownString, $userString) + public function testHashEqualsNonString($knownString, $userString): void { $this->assertFalse($this->test->testHashEquals($knownString, $userString)); } @@ -58,7 +59,7 @@ public function testHashEqualsNonString($knownString, $userString) * @param mixed $expected * @param mixed $delimiter */ - public function testCamelize($actual, $expected, $delimiter) + public function testCamelize($actual, $expected, $delimiter): void { $this->assertSame($expected, $this->test->camelize($actual, $delimiter)); } @@ -68,7 +69,7 @@ public function testCamelize($actual, $expected, $delimiter) * * @param mixed $delimiter */ - public function testCamelizeWrongSecondParam($delimiter) + public function testCamelizeWrongSecondParam($delimiter): void { $this->expectWarning(); $this->expectExceptionMessage( @@ -85,7 +86,7 @@ public function testCamelizeWrongSecondParam($delimiter) * @param mixed $expected * @param mixed $delimiter */ - public function testUnCamelize($actual, $expected, $delimiter) + public function testUnCamelize($actual, $expected, $delimiter): void { $this->assertSame($expected, $this->test->uncamelize($actual, $delimiter)); } @@ -95,7 +96,7 @@ public function testUnCamelize($actual, $expected, $delimiter) * * @param mixed $delimiter */ - public function testUnCamelizeWrongSecondParam($delimiter) + public function testUnCamelizeWrongSecondParam($delimiter): void { $this->expectWarning(); $this->expectExceptionMessage( @@ -105,7 +106,7 @@ public function testUnCamelizeWrongSecondParam($delimiter) $this->test->uncamelize('CameLiZe', $delimiter); } - public function testTrim() + public function testTrim(): void { $testSuite = [ [' hello ', 'hello'], @@ -120,7 +121,7 @@ public function testTrim() $this->assertSame($this->test->testTrim2Params('Hello World', 'Hdle'), 'o Wor'); } - public function testLtrim() + public function testLtrim(): void { $testSuite = [ [' hello ', 'hello '], @@ -135,7 +136,7 @@ public function testLtrim() $this->assertSame($this->test->testLtrim2Params('Hello World', 'Hdle'), 'o World'); } - public function testRtrim() + public function testRtrim(): void { $testSuite = [ [' hello ', ' hello'], @@ -150,19 +151,19 @@ public function testRtrim() $this->assertSame($this->test->testRtrim2Params('Hello World', 'Hdle'), 'Hello Wor'); } - public function testStrpos() + public function testStrpos(): void { $this->assertSame($this->test->testStrpos('abcdef abcdef', 'a'), 0); $this->assertSame($this->test->testStrposOffset('abcdef abcdef', 'a', 1), 7); } - public function testImplode() + public function testImplode(): void { $pieces = ['a', 'b', 'c']; $this->assertSame($this->test->testImplode(',', $pieces), 'a,b,c'); } - public function testExplode() + public function testExplode(): void { $pizza = 'piece1,piece2,piece3,piece4,piece5,piece6'; $ar1 = $this->test->testExplode(',', $pizza); @@ -193,8 +194,15 @@ public function providerSubstring(): array ]; } - /** @dataProvider providerSubstring */ - public function testSubstr(string $input, int $start, int $end, string $expected) + /** + * @dataProvider providerSubstring + * + * @param string $input + * @param int $start + * @param int $end + * @param string $expected + */ + public function testSubstr(string $input, int $start, int $end, string $expected): void { $this->assertSame($this->test->testSubstr($input, $start, $end), $expected); @@ -215,19 +223,29 @@ public function providerAddStripSlashes(): array ]; } - /** @dataProvider providerAddStripSlashes */ - public function testAddslashes(string $sample, string $expected) + /** + * @dataProvider providerAddStripSlashes + * + * @param string $sample + * @param string $expected + */ + public function testAddslashes(string $sample, string $expected): void { $this->assertSame($this->test->testAddslashes($sample), addslashes($expected)); } - /** @dataProvider providerAddStripSlashes */ - public function testStripslashes(string $sample, string $expected) + /** + * @dataProvider providerAddStripSlashes + * + * @param string $sample + * @param string $expected + */ + public function testStripslashes(string $sample, string $expected): void { $this->assertSame($this->test->testStripslashes(addslashes($sample)), $expected); } - public function testStripcslashes() + public function testStripcslashes(): void { parent::assertSame( stripcslashes('\abcd\e\f\g\h\i\j\k\l\m\n\o\pqrstuvwxy\z'), @@ -237,7 +255,7 @@ public function testStripcslashes() parent::assertSame(stripcslashes(''), $this->test->testStripcslashes('')); } - public function testMultilineStrings() + public function testMultilineStrings(): void { $hardcodedString = ' Hello world @@ -253,12 +271,12 @@ public function testMultilineStrings() $this->assertSame($escapedString, $this->test->testWellEscapedMultilineString()); } - public function testStrToHex() + public function testStrToHex(): void { $this->assertSame('746573742073656e74656e73652e2e2e', $this->test->strToHex('test sentense...')); } - public function providerHashEquals() + public function providerHashEquals(): array { return [ ['Phalcon', 'Phalcony', false], @@ -275,7 +293,7 @@ public function providerHashEquals() ]; } - public function providerHashEqualsNonString() + public function providerHashEqualsNonString(): array { return [ [null, 123, false], @@ -289,7 +307,7 @@ public function providerHashEqualsNonString() ]; } - public function providerCamelize() + public function providerCamelize(): array { return [ ['=_camelize', '=Camelize', '_'], @@ -307,7 +325,7 @@ public function providerCamelize() ]; } - public function providerUnCamelize() + public function providerUnCamelize(): array { return [ ['=Camelize', '=_camelize', '_'], @@ -322,7 +340,7 @@ public function providerUnCamelize() ]; } - public function providerCamelizeWrongSecondParam() + public function providerCamelizeWrongSecondParam(): array { return [ [''], diff --git a/tests/Extension/TernaryTest.php b/tests/Extension/TernaryTest.php index 6ca0df0a22..67be0f00f2 100644 --- a/tests/Extension/TernaryTest.php +++ b/tests/Extension/TernaryTest.php @@ -1,23 +1,26 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Ternary; -class TernaryTest extends TestCase +final class TernaryTest extends TestCase { - public function testTernary() + public function testTernary(): void { - $test = new \Stub\Ternary(); + $test = new Ternary(); $this->assertSame(101, $test->testTernary1()); $this->assertSame('foo', $test->testTernary2(true)); $this->assertSame('bar', $test->testTernary2(false)); @@ -36,9 +39,9 @@ public function testTernary() $this->assertSame([], $test->testShortTernaryComplex(false, [])); } - public function testComplex() + public function testComplex(): void { - $test = new \Stub\Ternary(); + $test = new Ternary(); $this->assertSame(101, $test->testTernaryComplex1([], '')); $this->assertSame(106, $test->testTernaryComplex2([], '')); $this->assertSame('boolean', $test->testTernaryComplex3('')); diff --git a/tests/Extension/TryTest.php b/tests/Extension/TryTest.php index 84a2f2ae26..5c73328151 100644 --- a/tests/Extension/TryTest.php +++ b/tests/Extension/TryTest.php @@ -1,21 +1,23 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; -class TryTest extends TestCase +final class TryTest extends TestCase { - public function testThrow1() + public function testThrow1(): void { $this->expectException('\Exception'); @@ -23,7 +25,7 @@ public function testThrow1() $test->testThrow1(); } - public function testThrow2() + public function testThrow2(): void { $this->expectException('\Exception'); diff --git a/tests/Extension/TypeHinting/AbstractTest.php b/tests/Extension/TypeHinting/AbstractTest.php index eb9c26cb7d..24e8f8fc66 100644 --- a/tests/Extension/TypeHinting/AbstractTest.php +++ b/tests/Extension/TypeHinting/AbstractTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension\TypeHinting; @@ -14,12 +16,12 @@ use PHPUnit\Framework\TestCase; use TestConcreteClass; -class AbstractTest extends TestCase +final class AbstractTest extends TestCase { /** * @issue https://github.com/phalcon/zephir/issues/1667 */ - public function testShouldCreateCompatibleChildClassUsingTypeHintedParams() + public function testShouldCreateCompatibleChildClassUsingTypeHintedParams(): void { $childClass = new TestConcreteClass(); @@ -37,7 +39,7 @@ public function testShouldCreateCompatibleChildClassUsingTypeHintedParams() /** * @issue https://github.com/phalcon/zephir/issues/1667 */ - public function testShouldCreateCompatibleChildClassWithMultipleReturnTypesHint() + public function testShouldCreateCompatibleChildClassWithMultipleReturnTypesHint(): void { $childClass = new TestConcreteClass(); $this->assertEquals('TestConcreteClass::returnOneOfScalar', $childClass->returnOneOfScalar()); @@ -46,7 +48,7 @@ public function testShouldCreateCompatibleChildClassWithMultipleReturnTypesHint( /** * @issue https://github.com/phalcon/zephir/issues/1667 */ - public function testShouldCreateCompatibleChildClassWithScalarType() + public function testShouldCreateCompatibleChildClassWithScalarType(): void { $childClass = new TestConcreteClass(); diff --git a/tests/Extension/TypeoffTest.php b/tests/Extension/TypeoffTest.php index 17a61cd995..bb56b3c8fd 100644 --- a/tests/Extension/TypeoffTest.php +++ b/tests/Extension/TypeoffTest.php @@ -1,64 +1,66 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Typeoff; -class TypeoffTest extends TestCase +final class TypeoffTest extends TestCase { - /** @var \Stub\Typeoff */ - private $test; + private Typeoff $test; protected function setUp(): void { - $this->test = new \Stub\Typeoff(); + $this->test = new Typeoff(); } - public function testNativeString() + public function testNativeString(): void { $this->assertFalse($this->test->testNativeStringFalse()); $this->assertTrue($this->test->testNativeStringTrue()); } - public function testNativeInt() + public function testNativeInt(): void { $this->assertFalse($this->test->testNativeIntFalse()); $this->assertTrue($this->test->testNativeIntTrue()); } - public function testNativeDouble() + public function testNativeDouble(): void { $this->assertTrue($this->test->testNativeDoubleTrue()); } - public function testNativeBool() + public function testNativeBool(): void { $this->assertFalse($this->test->testNativeBoolFalse()); $this->assertTrue($this->test->testNativeBoolTrue()); $this->assertFalse($this->test->testNotBoolTrue()); } - public function testArray() + public function testArray(): void { $this->assertFalse($this->test->testArrayFalse()); $this->assertTrue($this->test->testArrayTrue()); } - public function testClassProperty() + public function testClassProperty(): void { $this->assertTrue($this->test->testClassPropertyAccess()); } - public function testCallable() + public function testCallable(): void { $callback = function () { }; @@ -66,7 +68,7 @@ public function testCallable() $this->assertFalse($this->test->testCallableTypeOf(true)); } - public function testUnknown() + public function testUnknown(): void { $this->assertSame('string', $this->test->testUnknownTypeOf('test')); $this->assertSame('integer', $this->test->testUnknownTypeOf(5)); diff --git a/tests/Extension/UnsetTest.php b/tests/Extension/UnsetTest.php index c4be464002..f448537875 100644 --- a/tests/Extension/UnsetTest.php +++ b/tests/Extension/UnsetTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; @@ -14,28 +16,26 @@ use PHPUnit\Framework\TestCase; use Stub\Unsettest as UnsetTestExt; -class UnsetTest extends TestCase +final class UnsetTest extends TestCase { - /** @var UnsetTestExt */ - private $test; + private UnsetTestExt $test; protected function setUp(): void { $this->test = new UnsetTestExt(); } - public function testUnsetFromArray() + public function testUnsetFromArray(): void { $testVar = [1, 2, 3, 4, 5, 6]; + $this->assertSame([1 => 2, 3, 4, 5, 6], $this->test->testUnsetFromArray($testVar)); $this->assertSame([1 => 2, 3, 4, 5, 6], $this->test->testUnsetFromArrayByIndexVar($testVar, 0)); - $this->assertSame(['foo' => 'bar'], $this->test->testUnsetTypedArray(['foo' => 'bar', 'bar' => 'foo'], 'bar')); } - public function xtestUnsetValueFromProperty() + public function xtestUnsetValueFromProperty(): void { - //TODO: Zephir is not generating the correct code to make this work $testVar = [1, 2, 3, 4, 5, 6]; $this->assertFalse($this->test->has('testVar')); $this->test->addValueToProperty('testVar', $testVar); @@ -47,9 +47,8 @@ public function xtestUnsetValueFromProperty() $this->assertNull($this->test->getProperty()); } - public function xtestStdClassUnset() + public function xtestStdClassUnset(): void { - //TODO: Zephir is not generating the correct code to make this work $equalsStdClass = new \StdClass(); $equalsStdClass->property1 = 12345; $equalsStdClass->property3 = 12345; diff --git a/tests/Extension/VarsTest.php b/tests/Extension/VarsTest.php index fb439b8dcd..61df81ff96 100644 --- a/tests/Extension/VarsTest.php +++ b/tests/Extension/VarsTest.php @@ -1,24 +1,27 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Extension; use PHPUnit\Framework\TestCase; +use Stub\Vars; -class VarsTest extends TestCase +final class VarsTest extends TestCase { /** * Test var_dump function (array and string). */ - public function testVarDumpArrayAndString() + public function testVarDumpArrayAndString(): void { $this->setOutputCallback( function ($output) { @@ -35,30 +38,28 @@ function ($output) { 'string(5)"hello"' ); - $test = new \Stub\Vars(); - + $test = new Vars(); $test->testVarDump(); } /** * Test var_dump function with two params. */ - public function testVarDumpWithTwoParams() + public function testVarDumpWithTwoParams(): void { $this->expectOutputString( 'float(3.1)'."\n". 'bool(true)'."\n" ); - $test = new \Stub\Vars(); - + $test = new Vars(); $test->testVarDump2param(3.1, true); } /** * Test var_dump function with three params. */ - public function testVarDumpWithThreeParams() + public function testVarDumpWithThreeParams(): void { $this->setOutputCallback( function ($output) { @@ -72,12 +73,11 @@ function ($output) { 'array(3){[0]=>int(1)[1]=>int(2)[2]=>int(3)}' ); - $test = new \Stub\Vars(); - + $test = new Vars(); $test->testVarDump3param(3.1, true, [1, 2, 3]); } - public function testVarExport() + public function testVarExport(): void { $this->setOutputCallback( function ($output) { @@ -89,13 +89,13 @@ function ($output) { "array(0=>1,1=>'world',2=>false,)'hello'" ); - $test = new \Stub\Vars(); + $test = new Vars(); $this->assertSame($test->testVarExport(), "'hello'"); } - public function test88Issue() + public function test88Issue(): void { - $test = new \Stub\Vars(); + $test = new Vars(); $this->expectOutputString( 'string(3) "foo"'."\n". @@ -106,22 +106,21 @@ public function test88Issue() ); $test->test88Issue('foo', 'bar'); - $test->test88IssueParam2InitString('foo', 'bar'); } - public function testVarDumpAndCountOptimizer() + public function testVarDumpAndCountOptimizer(): void { $this->expectOutputString( 'int(5)'."\n". '5' ); - $test = new \Stub\Vars(); + $test = new Vars(); $test->testCountOptimizerVarDumpAndExport([1, 2, 3, 4, 5]); } - public function testArrayTypeVarDumpAndExport() + public function testArrayTypeVarDumpAndExport(): void { $this->setOutputCallback( function ($output) { @@ -134,57 +133,53 @@ function ($output) { 'array(0=>1,1=>2,2=>3,)' ); - $test = new \Stub\Vars(); + $test = new Vars(); $test->testArrayTypeVarDumpAndExport([1, 2, 3]); } - public function testIntVarDump() + public function testIntVarDump(): void { $this->expectOutputString( 'int(1)'."\n". '1' ); - $test = new \Stub\Vars(); + $test = new Vars(); $test->testIntVarDump(); } - public function testDoubleVarDump() + public function testDoubleVarDump(): void { - if (\PHP_VERSION_ID < 70000) { - $this->expectOutputString( - 'float(1)'."\n". - '1' - ); - } else { - $this->expectOutputString( - 'float(1)'."\n". - '1.0' - ); - } - - $test = new \Stub\Vars(); + $this->expectOutputString( + 'float(1)'."\n". + '1.0' + ); + + $test = new Vars(); $test->testDoubleVarDump(); } - public function testBoolVarDump() + public function testBoolVarDump(): void { $this->expectOutputString( 'bool(true)'."\n". 'true' ); - $test = new \Stub\Vars(); + $test = new Vars(); $test->testBoolVarDump(); } - public function testGetDefinedVars() + public function testGetDefinedVars(): void { - $test = new \Stub\Vars(); - // get_defined_vars() does NOT work in C (and hence Zephir) functions - // It will return variables of the most recent userland function - // down the call stack. - // In this case, all local variables of this method will be returned + $test = new Vars(); + + /** + * get_defined_vars() does NOT work in C (and hence Zephir) functions + * It will return variables of the most recent userland function + * down the call stack. + * In this case, all local variables of this method will be returned + */ $this->assertEquals(['test' => $test], $test->testGetDefinedVars()); } } diff --git a/tests/Zephir/AliasManagerTest.php b/tests/Zephir/AliasManagerTest.php index 1181d0b066..8b1325cb8d 100644 --- a/tests/Zephir/AliasManagerTest.php +++ b/tests/Zephir/AliasManagerTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -14,10 +16,9 @@ use PHPUnit\Framework\TestCase; use Zephir\AliasManager; -class AliasManagerTest extends TestCase +final class AliasManagerTest extends TestCase { - /** @var \Zephir\AliasManager */ - private $testAliasMgr; + private AliasManager $testAliasMgr; protected function setUp(): void { @@ -29,7 +30,6 @@ private function injectExpectedResult(array $expected): array $testDataProvider = $this->baseTestSuiteProvider(); $index = 0; - foreach ($testDataProvider as $testName => $testSuite) { $testDataProvider[$testName][] = $expected[$index++]; } @@ -88,8 +88,11 @@ public function aliasProvider(): array /** * @dataProvider aliasProvider + * + * @param array $useStatements + * @param array $expected */ - public function testShouldProperAddStatements(array $useStatements, array $expected) + public function testShouldProperAddStatements(array $useStatements, array $expected): void { $this->testAliasMgr->add([ 'aliases' => [$useStatements], @@ -116,8 +119,11 @@ public function statementProvider(): array /** * @dataProvider statementProvider + * + * @param array $useStatements + * @param bool $expected */ - public function testShouldCheckAliasedStatement(array $useStatements, bool $expected) + public function testShouldCheckAliasedStatement(array $useStatements, bool $expected): void { $this->testAliasMgr->add([ 'aliases' => [$useStatements], @@ -146,8 +152,11 @@ public function classNameDataProvider(): array /** * @dataProvider classNameDataProvider + * + * @param array $useStatements + * @param string $expected */ - public function testShouldGetAliasForClassName(array $useStatements, string $expected) + public function testShouldGetAliasForClassName(array $useStatements, string $expected): void { $this->testAliasMgr->add([ 'aliases' => [$useStatements], @@ -158,7 +167,7 @@ public function testShouldGetAliasForClassName(array $useStatements, string $exp $this->assertSame($expected, $this->testAliasMgr->getAliasForClassName($className)); } - public function testShouldCheckIfAliasPresentForClass() + public function testShouldCheckIfAliasPresentForClass(): void { $this->testAliasMgr->add([ 'aliases' => [ diff --git a/tests/Zephir/Backends/ZendEngine3/BackendTest.php b/tests/Zephir/Backends/ZendEngine3/BackendTest.php index 3ffa6441d7..41b8b6fd29 100644 --- a/tests/Zephir/Backends/ZendEngine3/BackendTest.php +++ b/tests/Zephir/Backends/ZendEngine3/BackendTest.php @@ -1,6 +1,8 @@ @@ -17,9 +19,9 @@ use Zephir\Config; use Zephir\Variable; -class BackendTest extends TestCase +final class BackendTest extends TestCase { - public function stringDataProvider() + public function stringDataProvider(): array { return [ 'regexp1' => ['/(\w+)\s*=\s*(\[[^\]]*\]|\"[^\"]*\"|[^,)]*)\s*(?:,|$)/', '/(\\w+)\\s*=\\s*(\\[[^\\]]*\\]|\"[^\"]*\"|[^,)]*)\\s*(?:,|$)/'], @@ -33,8 +35,11 @@ public function stringDataProvider() /** * @dataProvider stringDataProvider + * + * @param string $testString + * @param string $expectedString */ - public function testShouldEscapeStringWithRegexp(string $testString, string $expectedString) + public function testShouldEscapeStringWithRegexp(string $testString, string $expectedString): void { $backend = new Backend(new Config(), null, null); $variable = new Variable('variable', 'name'); diff --git a/tests/Zephir/CompilerFile/CheckDependenciesTest.php b/tests/Zephir/CompilerFile/CheckDependenciesTest.php index 4f45af695c..5b3ed38953 100644 --- a/tests/Zephir/CompilerFile/CheckDependenciesTest.php +++ b/tests/Zephir/CompilerFile/CheckDependenciesTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\CompilerFile; @@ -19,9 +21,9 @@ use Zephir\FileSystem\FileSystemInterface; use Zephir\Test\KernelTestCase; -class CheckDependenciesTest extends KernelTestCase +final class CheckDependenciesTest extends KernelTestCase { - public function testExtendsClassThatDoesNotExist() + public function testExtendsClassThatDoesNotExist(): void { self::bootKernel(['config_files' => [__DIR__.'/../../config.yml']]); diff --git a/tests/Zephir/CompilerFile/CheckPathSeparatorTest.php b/tests/Zephir/CompilerFile/CheckPathSeparatorTest.php index e5ec7c1e7d..c5dd8fc521 100644 --- a/tests/Zephir/CompilerFile/CheckPathSeparatorTest.php +++ b/tests/Zephir/CompilerFile/CheckPathSeparatorTest.php @@ -1,24 +1,27 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\CompilerFile; use PHPUnit\Framework\TestCase; -class CheckPathSeparatorTest extends TestCase +final class CheckPathSeparatorTest extends TestCase { - public function testExtendsClassThatDoesNotExist() + public function testExtendsClassThatDoesNotExist(): void { $configM4Path = realpath(__DIR__.'/../../../ext/config.m4'); $configM4Contents = file_get_contents($configM4Path); + $this->assertTrue(strpos($configM4Contents, 'stub/oo/abstractstatic.zep.c') !== false); } } diff --git a/tests/Zephir/ConfigExceptionTest.php b/tests/Zephir/ConfigExceptionTest.php index 186ddd703c..c1fe2096f7 100644 --- a/tests/Zephir/ConfigExceptionTest.php +++ b/tests/Zephir/ConfigExceptionTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Zephir\ConfigException; -class ConfigExceptionTest extends TestCase +final class ConfigExceptionTest extends TestCase { - public function testConstruct() + public function testConstruct(): void { $configException = new ConfigException('foo', 25); $this->assertSame($configException->getCode(), 25); diff --git a/tests/Zephir/ConfigTest.php b/tests/Zephir/ConfigTest.php index 3fc0117f0b..2d7b368815 100644 --- a/tests/Zephir/ConfigTest.php +++ b/tests/Zephir/ConfigTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -14,17 +16,16 @@ use PHPUnit\Framework\TestCase; use Zephir\Config; -class ConfigTest extends TestCase +final class ConfigTest extends TestCase { /** * Common directory. * * @var string */ - private $pwd; + private string $pwd; - /** @var Config */ - private $config; + private Config $config; protected function setUp(): void { @@ -45,7 +46,7 @@ protected function tearDown(): void /** * Clean config.json file into tmp dir. */ - private function cleanTmpConfigFile() + private function cleanTmpConfigFile(): void { /* clean config.json into tmp dir */ $tmpConfigFile = sys_get_temp_dir().\DIRECTORY_SEPARATOR.'config.json'; @@ -124,8 +125,10 @@ public function setConfigProvider(): array /** * @dataProvider setConfigProvider + * @param array $test + * @param mixed $expected */ - public function testShouldSetConfigParams(array $test, $expected) + public function testShouldSetConfigParams(array $test, $expected): void { list($key, $value, $namespace) = $test; $this->config->set($key, $value, $namespace); @@ -157,6 +160,10 @@ public function defaultConfigProvider(): array /** * @dataProvider defaultConfigProvider + * + * @param mixed $namespace + * @param string $key + * @param mixed $expected */ public function testShouldGetDefaultConfigParams($namespace, string $key, $expected) { @@ -183,15 +190,18 @@ public function offsetConfigProvider(): array /** * @dataProvider offsetConfigProvider + * + * @param array $key + * @param array $expected */ - public function testShouldGetWithOffsetConfigParams(array $key, array $expected) + public function testShouldGetWithOffsetConfigParams(array $key, array $expected): void { $actual = $this->config->offsetGet($key); $this->assertSame($expected, $actual); } - public function testShouldUnsetConfigParams() + public function testShouldUnsetConfigParams(): void { $initials = $this->config->get('test_setting_1', 'globals'); @@ -211,7 +221,7 @@ public function testShouldUnsetConfigParams() $this->assertNull($actual); } - public function testShouldGetBannerFromConfig() + public function testShouldGetBannerFromConfig(): void { $this->assertSame($this->stubsBanner(), $this->config->get('banner', 'stubs')); @@ -219,7 +229,7 @@ public function testShouldGetBannerFromConfig() $this->assertNull($this->config->get('banner', 'stubs')); } - public function testShouldSaveConfig() + public function testShouldSaveConfig(): void { chdir(sys_get_temp_dir()); diff --git a/tests/Zephir/Detectors/ReadDetectorTest.php b/tests/Zephir/Detectors/ReadDetectorTest.php index 6b6d209d36..4b35b86137 100644 --- a/tests/Zephir/Detectors/ReadDetectorTest.php +++ b/tests/Zephir/Detectors/ReadDetectorTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Detectors; @@ -14,7 +16,7 @@ use PHPUnit\Framework\TestCase; use Zephir\Detectors\ReadDetector; -class ReadDetectorTest extends TestCase +final class ReadDetectorTest extends TestCase { /** * @dataProvider variableProvider @@ -23,7 +25,7 @@ class ReadDetectorTest extends TestCase * @param string $variable * @param array $expression */ - public function testShouldDetectsIfVariableIsUsedInGivenExpressionContext(bool $expected, string $variable, array $expression) + public function testShouldDetectsIfVariableIsUsedInGivenExpressionContext(bool $expected, string $variable, array $expression): void { $detector = new ReadDetector(); diff --git a/tests/Zephir/Documentation/Annotation/LinkTest.php b/tests/Zephir/Documentation/Annotation/LinkTest.php index 0a211363c1..8b25051d39 100644 --- a/tests/Zephir/Documentation/Annotation/LinkTest.php +++ b/tests/Zephir/Documentation/Annotation/LinkTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation\Annotation; @@ -14,11 +16,11 @@ use PHPUnit\Framework\TestCase; use Zephir\Documentation\Annotation\Link; -class LinkTest extends TestCase +final class LinkTest extends TestCase { - const LINK_NAME = 'link'; + private const LINK_NAME = 'link'; - public function testShouldGetLink() + public function testShouldGetLink(): void { $link = new Link(self::LINK_NAME, ' sample with leading space '); @@ -33,7 +35,7 @@ public function testShouldGetLink() $this->assertSame('another link', $link->getString()); } - public function testShouldGetUri() + public function testShouldGetUri(): void { $testString = 'https://github.com/phalcon/zephir Zephir SRC'; @@ -44,7 +46,7 @@ public function testShouldGetUri() $this->assertSame('https://github.com/phalcon/zephir', $link->getUri()); } - public function testShouldGetLinkText() + public function testShouldGetLinkText(): void { $testString = 'https://github.com/phalcon/zephir Zephir SRC'; diff --git a/tests/Zephir/Documentation/Annotation/ReturnAnnotationTest.php b/tests/Zephir/Documentation/Annotation/ReturnAnnotationTest.php index 0ad440f31a..a14551f8d3 100644 --- a/tests/Zephir/Documentation/Annotation/ReturnAnnotationTest.php +++ b/tests/Zephir/Documentation/Annotation/ReturnAnnotationTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation\Annotation; @@ -14,11 +16,11 @@ use PHPUnit\Framework\TestCase; use Zephir\Documentation\Annotation\ReturnAnnotation; -class ReturnAnnotationTest extends TestCase +final class ReturnAnnotationTest extends TestCase { - const ANNOTATION_NAME = 'return'; + private const ANNOTATION_NAME = 'return'; - public function testShouldGetReturnAnnotation() + public function testShouldGetReturnAnnotation(): void { $link = new ReturnAnnotation(self::ANNOTATION_NAME, ' sample with leading space '); @@ -33,10 +35,9 @@ public function testShouldGetReturnAnnotation() $this->assertSame('array - Example description', $link->getString()); } - public function testShouldGetReturnType() + public function testShouldGetReturnType(): void { $testString = 'Zephir\EventInterface - Sample Event'; - $link = new ReturnAnnotation(self::ANNOTATION_NAME, $testString); $this->assertSame(self::ANNOTATION_NAME, $link->getName()); @@ -44,10 +45,9 @@ public function testShouldGetReturnType() $this->assertSame('Zephir\EventInterface', $link->getReturnType()); } - public function testShouldGetLinkText() + public function testShouldGetLinkText(): void { $testString = 'Zephir\EventInterface - Sample Event'; - $link = new ReturnAnnotation(self::ANNOTATION_NAME, $testString); $this->assertSame(self::ANNOTATION_NAME, $link->getName()); diff --git a/tests/Zephir/Documentation/Annotation/SeeTest.php b/tests/Zephir/Documentation/Annotation/SeeTest.php index b1d7a05cdf..02ae82715f 100644 --- a/tests/Zephir/Documentation/Annotation/SeeTest.php +++ b/tests/Zephir/Documentation/Annotation/SeeTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation\Annotation; @@ -14,11 +16,11 @@ use PHPUnit\Framework\TestCase; use Zephir\Documentation\Annotation\See; -class SeeTest extends TestCase +final class SeeTest extends TestCase { - const SEE_NAME = 'see'; + private const SEE_NAME = 'see'; - public function testShouldGetLink() + public function testShouldGetLink(): void { $link = new See(self::SEE_NAME, ' sample with leading space '); @@ -33,7 +35,7 @@ public function testShouldGetLink() $this->assertSame('another link', $link->getString()); } - public function testShouldGetResource() + public function testShouldGetResource(): void { $testString = 'https://github.com/phalcon/zephir Zephir SRC'; @@ -44,7 +46,7 @@ public function testShouldGetResource() $this->assertSame('https://github.com/phalcon/zephir', $link->getResource()); } - public function testShouldGetText() + public function testShouldGetText(): void { $testString = 'https://github.com/phalcon/zephir Zephir SRC'; diff --git a/tests/Zephir/Documentation/AnnotationTest.php b/tests/Zephir/Documentation/AnnotationTest.php index 7caf158dfb..3870272d03 100644 --- a/tests/Zephir/Documentation/AnnotationTest.php +++ b/tests/Zephir/Documentation/AnnotationTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation; @@ -14,9 +16,9 @@ use PHPUnit\Framework\TestCase; use Zephir\Documentation\Annotation; -class AnnotationTest extends TestCase +final class AnnotationTest extends TestCase { - public function testShouldGetAnnotation() + public function testShouldGetAnnotation(): void { $annotation = new Annotation('test annotation', ' sample with leading space '); diff --git a/tests/Zephir/Documentation/DocblockParserTest.php b/tests/Zephir/Documentation/DocblockParserTest.php index 760a9f02c3..c4dc4b34ce 100644 --- a/tests/Zephir/Documentation/DocblockParserTest.php +++ b/tests/Zephir/Documentation/DocblockParserTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation; @@ -19,9 +21,9 @@ use Zephir\Documentation\Docblock; use Zephir\Documentation\DocblockParser; -class DocblockParserTest extends TestCase +final class DocblockParserTest extends TestCase { - public function testShouldParseDocblockFromString() + public function testShouldParseDocblockFromString(): void { $test = << * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Documentation; @@ -15,7 +17,7 @@ use Zephir\Documentation\Annotation; use Zephir\Documentation\Docblock; -class DocblockTest extends TestCase +final class DocblockTest extends TestCase { private Docblock $docblock; @@ -54,7 +56,7 @@ public function testShouldGetAllProperties(): void $this->assertSame('See LICENSE.txt for more details.', $this->docblock->getSummary()); } - public function testShouldAddAnnotations() + public function testShouldAddAnnotations(): void { $annotation1 = new Annotation('see', 'https://github.com/phalcon/zephir Zephir homepage'); $annotation2 = new Annotation('link', 'https://github.com/phalcon/cphalcon Phalcon homepage'); @@ -70,7 +72,7 @@ public function testShouldAddAnnotations() $this->assertCount(3, $this->docblock->getAnnotations()); } - public function testShouldGenerateDocblock() + public function testShouldGenerateDocblock(): void { $expected = << @@ -16,9 +18,9 @@ use Zephir\FunctionLike\ReturnType\TypeInterface; use Zephir\Types; -class CastHintTest extends TestCase +final class CastHintTest extends TestCase { - public function testShouldReturnType() + public function testShouldReturnType(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertEquals(TypeInterface::TYPE_PARAMETER, $type->getType()); @@ -30,7 +32,7 @@ public function testShouldReturnType() $this->assertEquals('return-type-custom', $type->getType()); } - public function testShouldReturnDataType() + public function testShouldReturnDataType(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertEquals(Types::T_OBJECT, $type->getDataType()); @@ -39,7 +41,7 @@ public function testShouldReturnDataType() $this->assertEquals(Types::T_UNDEFINED, $type->getDataType()); } - public function testShouldReturnValue() + public function testShouldReturnValue(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertEquals('Class1', $type->getValue()); @@ -48,7 +50,7 @@ public function testShouldReturnValue() $this->assertEquals('\A\Namespaced\Class\Foo', $type->getValue()); } - public function testShouldAlwaysBeNotMandatory() + public function testShouldAlwaysBeNotMandatory(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertFalse($type->isMandatory()); @@ -57,7 +59,7 @@ public function testShouldAlwaysBeNotMandatory() $this->assertFalse($type->isMandatory()); } - public function testShouldDetectCollectionNature() + public function testShouldDetectCollectionNature(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertFalse($type->isCollection()); @@ -72,7 +74,7 @@ public function testShouldDetectCollectionNature() $this->assertFalse($type->isCollection()); } - public function testShouldAlwaysBeRealType() + public function testShouldAlwaysBeRealType(): void { $type = new CastHint(Types::T_OBJECT, 'Class1'); $this->assertFalse($type->isRealType()); diff --git a/tests/Zephir/FunctionLike/ReturnType/CollectionTest.php b/tests/Zephir/FunctionLike/ReturnType/CollectionTest.php index 299c2133c6..f68247d3a8 100644 --- a/tests/Zephir/FunctionLike/ReturnType/CollectionTest.php +++ b/tests/Zephir/FunctionLike/ReturnType/CollectionTest.php @@ -1,6 +1,8 @@ @@ -12,16 +14,17 @@ namespace Zephir\Test\FunctionLike\ReturnType; use PHPUnit\Framework\TestCase; +use Zephir\Exception\InvalidArgumentException; use Zephir\FunctionLike\ReturnType\CastHint; use Zephir\FunctionLike\ReturnType\Collection; use Zephir\FunctionLike\ReturnType\RealType; use Zephir\Types; -class CollectionTest extends TestCase +final class CollectionTest extends TestCase { - public function testShouldThrowExceptionOnInvalidAttachedObject() + public function testShouldThrowExceptionOnInvalidAttachedObject(): void { - $this->expectException(\Zephir\Exception\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( 'Expecting an instance of Zephir\FunctionLike\ReturnType\TypeInterface, got instance of stdClass' ); @@ -32,7 +35,7 @@ public function testShouldThrowExceptionOnInvalidAttachedObject() public function testShouldThrowExceptionOnInvalidAttachedValue(): void { - $this->expectException(\Zephir\Exception\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage( 'Expecting an instance of Zephir\FunctionLike\ReturnType\TypeInterface, got array' ); @@ -41,7 +44,7 @@ public function testShouldThrowExceptionOnInvalidAttachedValue(): void $collection->attach([]); } - public function testShouldAttachTypes() + public function testShouldAttachTypes(): void { $collection = new Collection(); @@ -64,7 +67,7 @@ public function testShouldAttachTypes() $this->assertCount(4, $collection); } - public function testShouldDetectOnlyVoid() + public function testShouldDetectOnlyVoid(): void { $collection = new Collection(); @@ -77,7 +80,7 @@ public function testShouldDetectOnlyVoid() $this->assertFalse($collection->onlyVoid()); } - public function testShouldCheckIfTheCollectionHasRealTypeOrCastHints() + public function testShouldCheckIfTheCollectionHasRealTypeOrCastHints(): void { $collection = new Collection(); $this->assertFalse($collection->hasReturnTypes()); @@ -93,7 +96,7 @@ public function testShouldCheckIfTheCollectionHasRealTypeOrCastHints() $this->assertTrue($collection->hasReturnTypes()); } - public function testShouldDetectWhetherReturnTypesAreNullCompatible() + public function testShouldDetectWhetherReturnTypesAreNullCompatible(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesNullCompatible()); @@ -113,7 +116,7 @@ public function testShouldDetectWhetherReturnTypesAreNullCompatible() $this->assertFalse($collection->areReturnTypesNullCompatible()); } - public function testShouldDetectWhetherReturnTypesAreSpecial() + public function testShouldDetectWhetherReturnTypesAreSpecial(): void { $collection = new Collection(); $this->assertFalse($collection->onlySpecial()); @@ -144,7 +147,7 @@ public function testShouldDetectWhetherReturnTypesAreSpecial() * @param string $type * @param bool $expected */ - public function testShouldDetectWhetherReturnTypesAreIntCompatible(string $type, bool $expected) + public function testShouldDetectWhetherReturnTypesAreIntCompatible(string $type, bool $expected): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesIntCompatible()); @@ -156,7 +159,7 @@ public function testShouldDetectWhetherReturnTypesAreIntCompatible(string $type, $this->assertSame($expected, $collection->areReturnTypesIntCompatible()); } - public function testShouldDetectWhetherReturnTypesAreDoubleCompatible() + public function testShouldDetectWhetherReturnTypesAreDoubleCompatible(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesDoubleCompatible()); @@ -176,7 +179,7 @@ public function testShouldDetectWhetherReturnTypesAreDoubleCompatible() $this->assertFalse($collection->areReturnTypesDoubleCompatible()); } - public function testShouldDetectWhetherReturnTypesAreBoolCompatible() + public function testShouldDetectWhetherReturnTypesAreBoolCompatible(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesBoolCompatible()); @@ -202,7 +205,7 @@ public function testShouldDetectWhetherReturnTypesAreBoolCompatible() * @param string $type * @param bool $expected */ - public function testShouldDetectWhetherReturnTypesAreStringCompatible(string $type, bool $expected) + public function testShouldDetectWhetherReturnTypesAreStringCompatible(string $type, bool $expected): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesStringCompatible()); @@ -214,7 +217,7 @@ public function testShouldDetectWhetherReturnTypesAreStringCompatible(string $ty $this->assertSame($expected, $collection->areReturnTypesStringCompatible()); } - public function testShouldDetectWhetherReturnTypesAreArrayCompatible() + public function testShouldDetectWhetherReturnTypesAreArrayCompatible(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesArrayCompatible()); @@ -247,7 +250,7 @@ public function testShouldDetectWhetherReturnTypesAreArrayCompatible() $this->assertFalse($collection->areReturnTypesArrayCompatible()); } - public function testShouldDetectWhetherReturnTypesAreObjectCompatible() + public function testShouldDetectWhetherReturnTypesAreObjectCompatible(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesObjectCompatible()); @@ -271,7 +274,7 @@ public function testShouldDetectWhetherReturnTypesAreObjectCompatible() $this->assertFalse($collection->areReturnTypesObjectCompatible()); } - public function testShouldDetectWellKnownTypes() + public function testShouldDetectWellKnownTypes(): void { $collection = new Collection(); $this->assertFalse($collection->areReturnTypesWellKnown()); @@ -333,7 +336,7 @@ public function testShouldDetectWellKnownTypes() * * @param string $type */ - public function testShouldDetectCompatibleTypesForTrivialCases($type) + public function testShouldDetectCompatibleTypesForTrivialCases(string $type): void { $collection = new Collection(); $this->assertTrue($collection->areReturnTypesCompatible()); @@ -342,7 +345,7 @@ public function testShouldDetectCompatibleTypesForTrivialCases($type) $this->assertTrue($collection->areReturnTypesCompatible()); } - public function intCompatibleProvider() + public function intCompatibleProvider(): array { $expected = [ true, true, true, true, true, true, @@ -360,7 +363,7 @@ function ($type, $expected) { ); } - public function stringCompatibleProvider() + public function stringCompatibleProvider(): array { $expected = [ false, false, false, false, false, @@ -379,7 +382,7 @@ function ($type, $expected) { ); } - public function compatibleTypesProvider() + public function compatibleTypesProvider(): array { return [ 'int' => [Types::T_INT], @@ -407,7 +410,7 @@ public function compatibleTypesProvider() ]; } - public function testShouldDetectCompatibleTypesForObjectLike() + public function testShouldDetectCompatibleTypesForObjectLike(): void { $collection = new Collection(); @@ -418,7 +421,7 @@ public function testShouldDetectCompatibleTypesForObjectLike() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForCollections() + public function testShouldDetectCompatibleTypesForCollections(): void { $collection = new Collection(); @@ -435,7 +438,7 @@ public function testShouldDetectCompatibleTypesForCollections() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForIntegers() + public function testShouldDetectCompatibleTypesForIntegers(): void { $collection = new Collection(); @@ -452,7 +455,7 @@ public function testShouldDetectCompatibleTypesForIntegers() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForBool() + public function testShouldDetectCompatibleTypesForBool(): void { $collection = new Collection(); @@ -463,7 +466,7 @@ public function testShouldDetectCompatibleTypesForBool() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForString() + public function testShouldDetectCompatibleTypesForString(): void { $collection = new Collection(); @@ -476,7 +479,7 @@ public function testShouldDetectCompatibleTypesForString() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForDouble() + public function testShouldDetectCompatibleTypesForDouble(): void { $collection = new Collection(); @@ -487,7 +490,7 @@ public function testShouldDetectCompatibleTypesForDouble() $this->assertFalse($collection->areReturnTypesCompatible()); } - public function testShouldDetectCompatibleTypesForKnownTypes() + public function testShouldDetectCompatibleTypesForKnownTypes(): void { $collection = new Collection(); @@ -528,7 +531,7 @@ public function testShouldDetectCompatibleTypesForKnownTypes() $this->assertTrue($collection->areReturnTypesCompatible()); } - public function testShouldGetOnlyRealTypes() + public function testShouldGetOnlyRealTypes(): void { $collection = new Collection(); $this->assertCount(0, $collection->getRealReturnTypes()); @@ -546,7 +549,7 @@ public function testShouldGetOnlyRealTypes() $this->assertCount(5, $collection->getRealReturnTypes()); } - public function testShouldGetOnlyCastHint() + public function testShouldGetOnlyCastHint(): void { $collection = new Collection(); $this->assertCount(0, $collection->getCastHintedReturnTypes()); diff --git a/tests/Zephir/FunctionLike/ReturnType/FactoryTest.php b/tests/Zephir/FunctionLike/ReturnType/FactoryTest.php index 26b8345124..86fe79124d 100644 --- a/tests/Zephir/FunctionLike/ReturnType/FactoryTest.php +++ b/tests/Zephir/FunctionLike/ReturnType/FactoryTest.php @@ -1,6 +1,8 @@ @@ -18,20 +20,20 @@ use Zephir\FunctionLike\ReturnType\TypeInterface; use Zephir\Types; -class FactoryTest extends TestCase +final class FactoryTest extends TestCase { /** * @dataProvider realTypeDataProvider * * @param array $ir */ - public function testShouldCreateRealType(array $ir) + public function testShouldCreateRealType(array $ir): void { $factory = new Factory(); $this->assertInstanceOf(RealType::class, $factory->create($ir)); } - public function realTypeDataProvider() + public function realTypeDataProvider(): array { return [ [ @@ -66,13 +68,13 @@ public function realTypeDataProvider() * * @param array $ir */ - public function testShouldCreateCastHint(array $ir) + public function testShouldCreateCastHint(array $ir): void { $factory = new Factory(); $this->assertInstanceOf(CastHint::class, $factory->create($ir)); } - public function castHintDataProvider() + public function castHintDataProvider(): array { return [ [ @@ -112,8 +114,7 @@ public function castHintDataProvider() ], [ [ - 'cast' => [ - ], + 'cast' => [], ], ], ]; diff --git a/tests/Zephir/FunctionLike/ReturnType/RealTypeTest.php b/tests/Zephir/FunctionLike/ReturnType/RealTypeTest.php index a112d2037c..f2dc8275c6 100644 --- a/tests/Zephir/FunctionLike/ReturnType/RealTypeTest.php +++ b/tests/Zephir/FunctionLike/ReturnType/RealTypeTest.php @@ -1,6 +1,8 @@ @@ -16,9 +18,9 @@ use Zephir\FunctionLike\ReturnType\TypeInterface; use Zephir\Types; -class RealTypeTest extends TestCase +final class RealTypeTest extends TestCase { - public function testShouldReturnType() + public function testShouldReturnType(): void { $type = new RealType(Types::T_STRING); $this->assertEquals(TypeInterface::TYPE_PARAMETER, $type->getType()); @@ -30,7 +32,7 @@ public function testShouldReturnType() $this->assertEquals('return-type-custom', $type->getType()); } - public function testShouldReturnMandatoryStatus() + public function testShouldReturnMandatoryStatus(): void { $type = new RealType(Types::T_STRING); $this->assertFalse($type->isMandatory()); @@ -42,13 +44,13 @@ public function testShouldReturnMandatoryStatus() $this->assertTrue($type->isMandatory()); } - public function testShouldAlwaysHaveNullableValue() + public function testShouldAlwaysHaveNullableValue(): void { $type = new RealType(Types::T_STRING); $this->assertNull($type->getValue()); } - public function testShouldAlwaysBeNotACollection() + public function testShouldAlwaysBeNotACollection(): void { $type = new RealType(Types::T_STRING); $this->assertFalse($type->isCollection()); @@ -57,7 +59,7 @@ public function testShouldAlwaysBeNotACollection() $this->assertFalse($type->isCollection()); } - public function testShouldReturnDataType() + public function testShouldReturnDataType(): void { $type = new RealType(Types::T_STRING); $this->assertEquals(Types::T_STRING, $type->getDataType()); @@ -69,7 +71,7 @@ public function testShouldReturnDataType() $this->assertEquals(Types::T_VOID, $type->getDataType()); } - public function testShouldAlwaysBeRealType() + public function testShouldAlwaysBeRealType(): void { $type = new RealType(Types::T_STRING); $this->assertTrue($type->isRealType()); diff --git a/tests/Zephir/HelpersTest.php b/tests/Zephir/HelpersTest.php index fb3fd87e57..928784b914 100644 --- a/tests/Zephir/HelpersTest.php +++ b/tests/Zephir/HelpersTest.php @@ -1,24 +1,27 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; use PHPUnit\Framework\TestCase; + use function Zephir\add_slashes; use function Zephir\camelize; use function Zephir\escape_class; -class HelpersTest extends TestCase +final class HelpersTest extends TestCase { - public function testShouldEscapeClassName() + public function testShouldEscapeClassName(): void { $classname = '\Bar\Foo'; $this->assertSame( @@ -27,7 +30,7 @@ public function testShouldEscapeClassName() ); } - public function testShouldCamelizeClassName() + public function testShouldCamelizeClassName(): void { $name = 'foo_Bar_Foo_bar'; $this->assertSame( @@ -67,8 +70,10 @@ public function cStringProvider(): array /** * @dataProvider cStringProvider + * @param string $testString + * @param string $expected */ - public function testShouldPrepareStringAsCString(string $testString, string $expected) + public function testShouldPrepareStringAsCString(string $testString, string $expected): void { $this->assertSame($expected, add_slashes($testString)); } diff --git a/tests/Zephir/KernelTestCase.php b/tests/Zephir/KernelTestCase.php index f66d68083c..8e06d606bc 100644 --- a/tests/Zephir/KernelTestCase.php +++ b/tests/Zephir/KernelTestCase.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -36,7 +38,7 @@ class KernelTestCase extends BaseTestCase * * @throws \RuntimeException */ - protected static function createKernel(array $options = []) + protected static function createKernel(array $options = []): KernelInterface { if (null === static::$class) { static::$class = static::getKernelClass(); @@ -79,7 +81,7 @@ protected static function createKernel(array $options = []) * * @param ContainerInterface $container */ - protected function muteOutput(ContainerInterface $container) + protected function muteOutput(ContainerInterface $container): void { try { $container->get(Config::class)->set('silent', true); diff --git a/tests/Zephir/Logger/Formatter/CompilerFormatterTest.php b/tests/Zephir/Logger/Formatter/CompilerFormatterTest.php index 5ae0bc4f3b..54fbea4749 100644 --- a/tests/Zephir/Logger/Formatter/CompilerFormatterTest.php +++ b/tests/Zephir/Logger/Formatter/CompilerFormatterTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Logger\Formatter; @@ -15,17 +17,16 @@ use Zephir\Config; use Zephir\Logger\Formatter\CompilerFormatter; -class CompilerFormatterTest extends TestCase +final class CompilerFormatterTest extends TestCase { - /** @var Config */ - private $config; + private Config $config; protected function setUp(): void { $this->config = new Config(); } - public function testShouldBeQuietWhenConfigSilent() + public function testShouldBeQuietWhenConfigSilent(): void { $this->config->set('silent', true); $compilerFormatter = new CompilerFormatter($this->config); @@ -59,7 +60,7 @@ public function getWarningContext(): array ]; } - public function testShouldBeQuietForDisabledWarning() + public function testShouldBeQuietForDisabledWarning(): void { // deny to print warnings for this category $this->config->offsetSet(['warnings' => 'unused-variable-external'], false); @@ -68,7 +69,7 @@ public function testShouldBeQuietForDisabledWarning() $this->assertSame('', $compilerFormatter->format($this->getWarningContext())); } - public function testShouldFormatWarningForCategory() + public function testShouldFormatWarningForCategory(): void { // allow to print warnings for this category $this->config->offsetSet(['warnings' => 'unused-variable-external'], true); @@ -88,7 +89,7 @@ public function testShouldFormatWarningForCategory() $this->assertSame($expected, $compilerFormatter->format($testContext)); } - public function testShouldFormatWithStripInfoLevels() + public function testShouldFormatWithStripInfoLevels(): void { $this->config->offsetSet(['warnings' => 'unused-variable-external'], true); $compilerFormatter = new CompilerFormatter($this->config); diff --git a/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php b/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php index 8b04eca33d..4df2445ffe 100644 --- a/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php +++ b/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php @@ -1,6 +1,8 @@ @@ -15,11 +17,12 @@ use PHPUnit\Framework\TestCase; use Zephir\Call; use Zephir\CompilationContext; +use Zephir\Exception\CompilerException; use Zephir\Optimizers\FunctionCall\PregMatchOptimizer; use Zephir\SymbolTable; use Zephir\Variable; -class PregMatchOptimizerTest extends TestCase +final class PregMatchOptimizerTest extends TestCase { /** @var Call|MockObject */ protected $callMock; @@ -46,7 +49,7 @@ protected function setUp(): void */ public function testShouldThrowExceptionIfNoParametersGiven(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage('preg_match() expects at least 2 parameters, 0 given'); $optimizer = new PregMatchOptimizer(); @@ -63,7 +66,7 @@ public function testShouldThrowExceptionIfNoParametersGiven(): void */ public function testShouldThrowExceptionIfParametersLessThanRequired(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage('preg_match() expects at least 2 parameters, 0 given'); $optimizer = new PregMatchOptimizer(); @@ -80,7 +83,7 @@ public function testShouldThrowExceptionIfParametersLessThanRequired(): void */ public function testShouldThrowExceptionIfParametersMoreThanRequired(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage('preg_match() expects at most 5 parameters, 7 given'); $optimizer = new PregMatchOptimizer(); @@ -97,7 +100,7 @@ public function testShouldThrowExceptionIfParametersMoreThanRequired(): void */ public function testShouldThrowExceptionIfMatchedIsNotVariable(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage('Only variables can be passed by reference'); $optimizer = new PregMatchOptimizer(); @@ -118,12 +121,11 @@ public function testShouldThrowExceptionIfMatchedIsNotVariable(): void } /** - * @throws \ReflectionException * @issue https://github.com/phalcon/zephir/issues/1697 */ public function testShouldThrowExceptionIfUsedUndefinedMatchesVariable(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage("Cannot mutate variable 'matches' because it wasn't defined"); $optimizer = new PregMatchOptimizer(); @@ -155,12 +157,11 @@ public function testShouldThrowExceptionIfUsedUndefinedMatchesVariable(): void } /** - * @throws \ReflectionException * @issue https://github.com/phalcon/zephir/issues/1697 */ public function testShouldThrowExceptionIfMatchesHasUnexpectedType(): void { - $this->expectException(\Zephir\Exception\CompilerException::class); + $this->expectException(CompilerException::class); $this->expectExceptionMessage("The 'matches' variable must be either a variable or an array, got Ooops"); $optimizer = new PregMatchOptimizer(); diff --git a/tests/Zephir/Statements/Let/VariableTest.php b/tests/Zephir/Statements/Let/VariableTest.php index ccfeb339bf..d8b773b796 100644 --- a/tests/Zephir/Statements/Let/VariableTest.php +++ b/tests/Zephir/Statements/Let/VariableTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Statements\Let; @@ -20,19 +22,12 @@ use Zephir\Statements\Let\Variable; use Zephir\Variable as ZephirVariable; -class VariableTest extends TestCase +final class VariableTest extends TestCase { - /** @var Variable */ - private $test; - - /** @var ReadDetector */ - private $readDetector; - - /** @var CompilationContext */ - private $compilationCtx; - - /** @var CompiledExpression */ - private $compiledExpr; + private Variable $test; + private ReadDetector $readDetector; + private CompilationContext $compilationCtx; + private CompiledExpression $compiledExpr; protected function setUp(): void { @@ -77,7 +72,7 @@ function (ZephirVariable $var) { * @param string $message - Expected error message * @param callable $setProperty - Callback func to set required for test property */ - public function testThrowsExceptionForWrongVariables(array $statement, string $message, callable $setProperty) + public function testThrowsExceptionForWrongVariables(array $statement, string $message, callable $setProperty): void { $zephirVariable = new ZephirVariable('variable', 'foo'); // call necessary setters for test case diff --git a/tests/Zephir/Stubs/DocBlockTest.php b/tests/Zephir/Stubs/DocBlockTest.php index f12257d1ba..4e9ed10f8f 100644 --- a/tests/Zephir/Stubs/DocBlockTest.php +++ b/tests/Zephir/Stubs/DocBlockTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Stubs; @@ -14,16 +16,16 @@ use PHPUnit\Framework\TestCase; use Zephir\Stubs\DocBlock; -class DocBlockTest extends TestCase +final class DocBlockTest extends TestCase { - public function testInitialState() + public function testInitialState(): void { $docBlock = new DocBlock(''); $this->assertSame('', (string) $docBlock); } - public function testDescription() + public function testDescription(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocs() + public function testPhpDocs(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocWithDescription() + public function testPhpDocWithDescription(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocWithCodeBloc() + public function testPhpDocWithCodeBloc(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocWithScalarParams() + public function testPhpDocWithScalarParams(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocWithVariousDocBlockTags() + public function testPhpDocWithVariousDocBlockTags(): void { $doc = <<assertSame($expected, (string) $docBlock); } - public function testPhpDocWithDoubleDollarSymbols() + public function testPhpDocWithDoubleDollarSymbols(): void { $doc = << * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Stubs; use PHPUnit\Framework\TestCase; +use ReflectionException; use Zephir\AliasManager; use Zephir\ClassConstant; use Zephir\ClassDefinition; @@ -22,9 +25,12 @@ class GeneratorTest extends TestCase { + /** + * @var mixed + */ private $generatorClass; - private $testClass; - private $classDefinition; + private Generator $testClass; + private ClassDefinition $classDefinition; protected function setUp(): void { @@ -37,6 +43,8 @@ protected function setUp(): void * Modify method visibility to call protected. * * @param string $name - method name + * @return mixed + * @throws ReflectionException */ private function getMethod(string $name) { @@ -46,7 +54,7 @@ private function getMethod(string $name) return $method; } - public function testShouldBuildClass() + public function testShouldBuildClass(): void { $expected = << [ @@ -304,8 +318,13 @@ public function constantProvider(): array /** * @dataProvider constantProvider + * + * @param string $type + * @param $value + * @param string $expected + * @throws ReflectionException */ - public function testShouldBuildConstant(string $type, $value, string $expected) + public function testShouldBuildConstant(string $type, $value, string $expected): void { $buildClass = $this->getMethod('buildConstant'); @@ -346,7 +365,7 @@ public function testShouldBuildConstant(string $type, $value, string $expected) $this->assertSame(PHP_EOL.$expected, $actual); } - public function testShouldBuildMethod() + public function testShouldBuildMethod(): void { $buildClass = $this->getMethod('buildMethod'); diff --git a/tests/Zephir/Stubs/MethodDocBlockTest.php b/tests/Zephir/Stubs/MethodDocBlockTest.php index 1565fc99f9..8ae56cb46f 100644 --- a/tests/Zephir/Stubs/MethodDocBlockTest.php +++ b/tests/Zephir/Stubs/MethodDocBlockTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test\Stubs; @@ -19,9 +21,9 @@ use Zephir\StatementsBlock; use Zephir\Stubs\MethodDocBlock; -class MethodDocBlockTest extends TestCase +final class MethodDocBlockTest extends TestCase { - public function prepareMethod($params) + public function prepareMethod(array $params): MethodDocBlock { /** * ClassDefinition for Class creation. @@ -71,12 +73,10 @@ public function prepareMethod($params) $methodExpression ); - $aliasManager = new AliasManager(); - - return new MethodDocBlock($classMethod, $aliasManager); + return new MethodDocBlock($classMethod, new AliasManager()); } - public function getDocBlock() + public function getDocBlock(): array { return [ [ @@ -128,7 +128,7 @@ public function getDocBlock() * @param array $parameters * @param string $expected */ - public function testMethodsWithDataSet(array $parameters, $expected) + public function testMethodsWithDataSet(array $parameters, string $expected): void { $baseDefinition = require ZEPHIRPATH.'/tests/fixtures/base-definition.php'; $baseDefinition['method']['parameters'][] = $parameters; @@ -244,8 +244,11 @@ public function docBlockProvider(): array /** * @dataProvider docBlockProvider() + * + * @param string $zephirDocBlock + * @param string $phpDocBlock */ - public function testShouldParseDocBlock(string $zephirDocBlock, string $phpDocBlock) + public function testShouldParseDocBlock(string $zephirDocBlock, string $phpDocBlock): void { $classMethod = new ClassMethod( new ClassDefinition('Zephir', 'testMethod'), diff --git a/tests/Zephir/TypesTest.php b/tests/Zephir/TypesTest.php index 35981a305f..d5e22d3889 100644 --- a/tests/Zephir/TypesTest.php +++ b/tests/Zephir/TypesTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -16,12 +18,13 @@ use Zephir\ClassMethod; use Zephir\Types; -class TypesTest extends TestCase +final class TypesTest extends TestCase { /** * Helper to build proper structure with method return types. * * @param array $returnTypesList - collactions with all return types + * @return array */ private function buildReturnTypes(array $returnTypesList): array { @@ -38,8 +41,9 @@ private function buildReturnTypes(array $returnTypesList): array /** * Builds base object definition for return type. * - * @param array $types - list of method return types - * @param int $mandatory - is mandatory flag + * @param array $types - list of method return types + * @param int $mandatory - is mandatory flag + * @return array */ private function baseReturnTypeDefinition(array $types, int $mandatory = 0): array { @@ -63,6 +67,7 @@ function ($type) use ($mandatory) { * * @param array $types - list of method return types * @param int $collection - is collection flag + * @return array */ private function variableReturnTypeDefinition(array $types, int $collection = 0): array { @@ -183,15 +188,17 @@ public function typesProvider(): array /** * @dataProvider typesProvider + * + * @param array $returnTypes + * @param string $expected */ - public function testShouldResolveCompatibleTypeForBaseTypes(array $returnTypes, string $expected) + public function testShouldResolveCompatibleTypeForBaseTypes(array $returnTypes, string $expected): void { $testMethod = $this->buildMethod( $this->baseReturnTypeDefinition($returnTypes) ); $testTypes = new Types(); - $actual = $testTypes->getReturnTypeAnnotation($testMethod); $this->assertSame($expected, $actual); @@ -220,8 +227,11 @@ public function objectsProvider(): array /** * @dataProvider objectsProvider + * + * @param array $returnTypes + * @param string $expected */ - public function testShouldResolveCompatibleTypeForObjects(array $returnTypes, string $expected) + public function testShouldResolveCompatibleTypeForObjects(array $returnTypes, string $expected): void { $withAliases = []; foreach ($returnTypes as $alias) { @@ -263,8 +273,11 @@ public function collectionsProvider(): array /** * @dataProvider collectionsProvider + * + * @param array $returnTypes + * @param string $expected */ - public function testShouldResolveCompatibleTypeForCollections(array $returnTypes, string $expected) + public function testShouldResolveCompatibleTypeForCollections(array $returnTypes, string $expected): void { $typesList = []; $collections = []; @@ -279,9 +292,7 @@ public function testShouldResolveCompatibleTypeForCollections(array $returnTypes } $testMethod = $this->buildMethod($typesList); - $testTypes = new Types(); - $actual = $testTypes->getReturnTypeAnnotation( $testMethod, array_merge($testMethod->getReturnTypes(), $collections) diff --git a/tests/Zephir/VariableTest.php b/tests/Zephir/VariableTest.php index d9bdd28067..7e2b4ff9f4 100644 --- a/tests/Zephir/VariableTest.php +++ b/tests/Zephir/VariableTest.php @@ -1,12 +1,14 @@ * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. */ namespace Zephir\Test; @@ -20,17 +22,16 @@ use Zephir\Exception\CompilerException; use Zephir\Variable; -class VariableTest extends TestCase +final class VariableTest extends TestCase { - /** @var Variable */ - private $zephirVar; + private Variable $zephirVar; protected function setUp(): void { $this->zephirVar = new Variable('object', 'UnitTest'); } - public function testShouldSetProperties() + public function testShouldSetProperties(): void { $context = new CompilationContext(); $branch = new Branch(); @@ -203,7 +204,7 @@ public function testShouldSetProperties() $this->assertSame($branch, $this->zephirVar->getPossibleValueBranch()); } - public function testShouldEnableDefaultAutoInitValue() + public function testShouldEnableDefaultAutoInitValue(): void { $numericTypes = [ 'char', 'boolean', 'bool', 'int', 'uint', 'long', 'ulong', From 1a532edc12e3049f1ee1eb65b5913dc6d5bfe3a4 Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sun, 7 Mar 2021 16:54:44 +0000 Subject: [PATCH 3/3] #2111 - Mass rename of repository URL --- .github/workflows/build-unix.yml | 6 +- .github/workflows/build-windows.yml | 6 +- CHANGELOG.md | 270 +++++++++--------- CONTRIBUTING.md | 2 +- .../Backends/ZendEngine3/VariablesManager.php | 2 +- Library/ClassMethodParameters.php | 2 +- Library/Console/Command/GenerateCommand.php | 2 +- Library/Operators/Other/CastOperator.php | 2 +- Library/Stubs/Generator.php | 4 +- README.md | 8 +- composer.json | 6 +- ext/stub/arraysearch.zep.c | 4 +- ext/stub/assign.zep.c | 16 +- ext/stub/bitwise.zep.c | 2 +- ext/stub/cast.zep.c | 24 +- ext/stub/compare.zep.c | 2 +- ext/stub/concat.zep.c | 6 +- ext/stub/constants.zep.c | 2 +- ext/stub/exception.zep.c | 2 +- ext/stub/functions.zep.c | 4 +- ext/stub/globals/post.zep.c | 2 +- ext/stub/globals/server.zep.c | 4 +- ext/stub/globals/serverrequestfactory.zep.c | 2 +- ext/stub/mcall.zep.c | 2 +- ext/stub/mcalldynamic.zep.c | 2 +- ext/stub/methodargs.zep.c | 10 +- ext/stub/nativearray.zep.c | 4 +- ext/stub/oo/propertyaccess.zep.c | 4 +- ext/stub/oo/scopes/privatescopetester.zep.c | 8 +- ext/stub/optimizers/strreplace.zep.c | 2 +- ext/stub/pregmatch.zep.c | 2 +- ext/stub/properties/propertyarray.zep.c | 2 +- ext/stub/properties/publicproperties.zep.c | 4 +- ext/stub/properties/staticpropertyarray.zep.c | 4 +- ext/stub/spropertyaccess.zep.c | 4 +- ext/stub/statements.zep.c | 2 +- ext/stub/ternary.zep.c | 4 +- ext/stub/vars.zep.c | 2 +- stub/arraysearch.zep | 4 +- stub/assign.zep | 16 +- stub/bitwise.zep | 2 +- stub/cast.zep | 24 +- stub/compare.zep | 2 +- stub/concat.zep | 6 +- stub/constants.zep | 2 +- stub/exception.zep | 2 +- stub/functions.zep | 4 +- stub/globals/post.zep | 2 +- stub/globals/server.zep | 4 +- stub/globals/serverrequestfactory.zep | 2 +- stub/mcall.zep | 2 +- stub/mcalldynamic.zep | 2 +- stub/methodargs.zep | 10 +- stub/nativearray.zep | 4 +- stub/oo/propertyaccess.zep | 4 +- stub/oo/scopes/privatescopetester.zep | 8 +- stub/optimizers/strreplace.zep | 2 +- stub/pregmatch.zep | 2 +- stub/properties/propertyarray.zep | 2 +- stub/properties/publicproperties.zep | 4 +- stub/properties/staticpropertyarray.zep | 4 +- stub/spropertyaccess.zep | 4 +- stub/statements.zep | 2 +- stub/ternary.zep | 4 +- stub/vars.zep | 2 +- tests/Extension/ArraySearchTest.php | 4 +- tests/Extension/BitwiseTest.php | 2 +- tests/Extension/CastTest.php | 14 +- tests/Extension/ConcatTest.php | 6 +- tests/Extension/ConstantsTest.php | 2 +- tests/Extension/FunctionExistsTest.php | 6 +- tests/Extension/Globals/PostTest.php | 6 +- .../Globals/ServerRequestFactoryTest.php | 2 +- tests/Extension/Globals/ServerTest.php | 4 +- tests/Extension/InstanceOffTest.php | 10 +- tests/Extension/InstanceTest.php | 2 +- tests/Extension/MCallDynamicTest.php | 2 +- tests/Extension/McallInternalTest.php | 2 +- tests/Extension/Oo/ExtendClassTest.php | 6 +- .../Extension/Oo/Scopes/PrivateScopeTest.php | 38 +-- tests/Extension/OoTest.php | 2 +- .../Extension/Optimizers/IsPhpVersionTest.php | 2 +- tests/Extension/PregmatchTest.php | 4 +- .../Properties/ProtectedPropertiesTest.php | 2 +- .../Properties/PublicPropertiesTest.php | 2 +- .../StaticPrivatePropertiesTest.php | 2 +- .../Properties/StaticPublicPropertiesTest.php | 2 +- tests/Extension/RequiresTest.php | 6 +- tests/Extension/ReturnsTest.php | 8 +- tests/Extension/SPropertyAccessTest.php | 4 +- tests/Extension/ScallLateConstructTest.php | 2 +- tests/Extension/ScallTest.php | 4 +- tests/Extension/TypeHinting/AbstractTest.php | 6 +- .../Documentation/Annotation/LinkTest.php | 6 +- .../Documentation/Annotation/SeeTest.php | 6 +- .../Documentation/DocblockParserTest.php | 8 +- tests/Zephir/Documentation/DocblockTest.php | 8 +- .../FunctionCall/PregMatchOptimizerTest.php | 12 +- tests/Zephir/Stubs/DocBlockTest.php | 4 +- tests/fixtures/typehints/typehints/retval.zep | 20 +- tests/sharness/t0002-generate.sh | 2 +- tests/sharness/t0005-stubs.sh | 18 +- 102 files changed, 399 insertions(+), 399 deletions(-) diff --git a/.github/workflows/build-unix.yml b/.github/workflows/build-unix.yml index 51378f09a2..cefa521f06 100644 --- a/.github/workflows/build-unix.yml +++ b/.github/workflows/build-unix.yml @@ -50,9 +50,9 @@ jobs: extensions: gmp, pdo_sqlite, psr, zip tools: phpize, php-config coverage: xdebug - # variables_order: https://github.com/phalcon/zephir/pull/1537 - # enable_dl: https://github.com/phalcon/zephir/pull/1654 - # allow_url_fopen: https://github.com/phalcon/zephir/issues/1713 + # variables_order: https://github.com/zephir-lang/zephir/pull/1537 + # enable_dl: https://github.com/zephir-lang/zephir/pull/1654 + # allow_url_fopen: https://github.com/zephir-lang/zephir/issues/1713 # error_reporting: https://github.com/zendframework/zend-code/issues/160 ini-values: >- variables_order=EGPCS, diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index fe8dfe2878..6244e63394 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -48,9 +48,9 @@ jobs: php-version: ${{ matrix.php }} extensions: mbstring, fileinfo, gmp, sqlite, pdo_sqlite, psr, zip coverage: none - # variables_order: https://github.com/phalcon/zephir/pull/1537 - # enable_dl: https://github.com/phalcon/zephir/pull/1654 - # allow_url_fopen: https://github.com/phalcon/zephir/issues/1713 + # variables_order: https://github.com/zephir-lang/zephir/pull/1537 + # enable_dl: https://github.com/zephir-lang/zephir/pull/1654 + # allow_url_fopen: https://github.com/zephir-lang/zephir/issues/1713 # error_reporting: https://github.com/zendframework/zend-code/issues/160 ini-values: >- variables_order=EGPCS, diff --git a/CHANGELOG.md b/CHANGELOG.md index be0ee9e434..f1492d1b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,18 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.12.21] - 2021-03-05 ### Fixed -- Fixed path separators in generated `config.m4` file on Windows [#2153](https://github.com/phalcon/zephir/issues/2153) +- Fixed path separators in generated `config.m4` file on Windows [#2153](https://github.com/zephir-lang/zephir/issues/2153) ## [0.12.20] - 2020-12-16 ### Added - Added supports void type return value for stubs [phalcon/ide-stubs#50](https://github.com/phalcon/ide-stubs/pull/50) - [#1977](https://github.com/phalcon/zephir/issues/1977) + [#1977](https://github.com/zephir-lang/zephir/issues/1977) ### Fixed - Fixed missing kernel directory at build time [ice/framework#271](https://github.com/ice/framework/issues/271) - Fixed stubs generation for case with array declaration with square brackets in params -- Fixed parameters positioning for `implode()` php function [#2120](https://github.com/phalcon/zephir/issues/2120) +- Fixed parameters positioning for `implode()` php function [#2120](https://github.com/zephir-lang/zephir/issues/2120) ## [0.12.19] - 2020-05-13 ### Fixed @@ -27,30 +27,30 @@ and this project adheres to [Semantic Versioning](http://semver.org). [ice/framework#266](https://github.com/ice/framework/pull/266) - Fixed initialization of object properties with default values when the object is an instance of a child class - [#2089](https://github.com/phalcon/zephir/issues/2089) + [#2089](https://github.com/zephir-lang/zephir/issues/2089) ### Changed - Improved stubs generation for methods which may return object or null - [#2092](https://github.com/phalcon/zephir/issues/2092) + [#2092](https://github.com/zephir-lang/zephir/issues/2092) ## [0.12.18] - 2020-04-25 ### Fixed - In some cases for C "control characters" aren't properly escaped - [#2065](https://github.com/phalcon/zephir/issues/2065) + [#2065](https://github.com/zephir-lang/zephir/issues/2065) - Zephir ignored property visibility and has not thrown error when setting private/protected properties in scope that shouldn't intend for it - [#2078](https://github.com/phalcon/zephir/pull/2078), + [#2078](https://github.com/zephir-lang/zephir/pull/2078), [phalcon/cphalcon#14810](https://github.com/phalcon/cphalcon/issues/14810), [phalcon/cphalcon#14766](https://github.com/phalcon/cphalcon/issues/14766) ## [0.12.17] - 2020-02-14 ### Fixed - On some platforms special alpha characters aren't correctly escaped. - [#2058](https://github.com/phalcon/zephir/pull/2058) + [#2058](https://github.com/zephir-lang/zephir/pull/2058) ### Changed - Changed the internal DI environment mode when compile PHAR - [#2049](https://github.com/phalcon/zephir/pull/2049) + [#2049](https://github.com/zephir-lang/zephir/pull/2049) ## [0.12.16] - 2020-01-16 ### Fixed @@ -58,24 +58,24 @@ and this project adheres to [Semantic Versioning](http://semver.org). Usually we need dump configuration exactly once - at project initialization. There are no needs to dump it for every config change. Also, this patch removes `Config::$changed` variable that is no longer needed - [#2035](https://github.com/phalcon/zephir/pull/2035) + [#2035](https://github.com/zephir-lang/zephir/pull/2035) - Use a different path for the Kernel cache if possible. This patch fixes a cache collision issue. The issue is after creating the cache and filling it with a project-specific configuration, there is no way to invalidate it. Any next project will use the same Kernel cache and the same Kernel configuration (if any). - [#2036](https://github.com/phalcon/zephir/pull/2036) + [#2036](https://github.com/zephir-lang/zephir/pull/2036) - Fixed `-V` CLI flag purpose. Initially it was designed to disable verbose mode on the fly, e.g. to override project configuration for a single Zephir pass. This behavior was returned back. - Fix increment array elements operation - [#2020](https://github.com/phalcon/zephir/issues/2020) + [#2020](https://github.com/zephir-lang/zephir/issues/2020) - Fixed compound addition and subtraction assignment operators for static properties - [#2038](https://github.com/phalcon/zephir/issues/2038) + [#2038](https://github.com/zephir-lang/zephir/issues/2038) ### Changed - Improved type hint for arrays when generating stubs - [#2026](https://github.com/phalcon/zephir/issues/2026) + [#2026](https://github.com/zephir-lang/zephir/issues/2026) ## [0.12.15] - 2019-12-12 ### Removed @@ -95,54 +95,54 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.12.12] - 2019-11-25 ### Added - Option to set banner for stubs generator - [#1987](https://github.com/phalcon/zephir/1987) + [#1987](https://github.com/zephir-lang/zephir/1987) ### Fixed - Calling object methods from static context yields segmentation fault when `internal-call-transformation` is set to `TRUE` - [#2000](https://github.com/phalcon/zephir/issues/2000) + [#2000](https://github.com/zephir-lang/zephir/issues/2000) - Certain method calls fail when called from static context when `internal-call-transformation` is set to `TRUE` - [#2005](https://github.com/phalcon/zephir/issues/2005) + [#2005](https://github.com/zephir-lang/zephir/issues/2005) - Method context loses track of `this` after calling static method when `internal-call-transformation` is set to `TRUE` - [#2007](https://github.com/phalcon/zephir/issues/2007) + [#2007](https://github.com/zephir-lang/zephir/issues/2007) - Fixed incorrect stubs generation for return type hint - [#1990](https://github.com/phalcon/zephir/issues/1990) + [#1990](https://github.com/zephir-lang/zephir/issues/1990) - Fixed incorrect stubs generation for classes in the same namespace - [#2016](https://github.com/phalcon/zephir/issues/2016) + [#2016](https://github.com/zephir-lang/zephir/issues/2016) ## [0.12.11] - 2019-11-02 ### Fixed - Fixed arithmetical operations with `zvals` which stores `double` numbers - Fixed updating static variables in the loop which represents `double` and - `integer` data types [#1494](https://github.com/phalcon/zephir/issues/1494) + `integer` data types [#1494](https://github.com/zephir-lang/zephir/issues/1494) - Fixed casting char into another of a different type - [#1988](https://github.com/phalcon/zephir/issues/1988) + [#1988](https://github.com/zephir-lang/zephir/issues/1988) - Fixed `internal` methods definition when `internal-call-transformation` is enabled - [#1956](https://github.com/phalcon/zephir/issues/1956) + [#1956](https://github.com/zephir-lang/zephir/issues/1956) - Fixed aliases using in the `use` statement when generating stubs - [#1986](https://github.com/phalcon/zephir/issues/1986) + [#1986](https://github.com/zephir-lang/zephir/issues/1986) - Fixed incorrect namespace on type hinted return when generating API docs - [#1229](https://github.com/phalcon/zephir/issues/1229) + [#1229](https://github.com/zephir-lang/zephir/issues/1229) ## [0.12.10] - 2019-10-19 ### Fixed - Fixed incorrect behavior in `zephir_get_global` if `zval` reference count <= 1 - [#1961](https://github.com/phalcon/zephir/issues/1961) + [#1961](https://github.com/zephir-lang/zephir/issues/1961) ### Removed - Removed `--vernum` option from the help for regular commands - Removed `void` from the return type hint in the generated stubs - [#1977](https://github.com/phalcon/zephir/issues/1977) + [#1977](https://github.com/zephir-lang/zephir/issues/1977) - Remove no longer supported `TSRMLS_CC` usage - [#1865](https://github.com/phalcon/zephir/issues/1865) + [#1865](https://github.com/zephir-lang/zephir/issues/1865) ### Changed - Disabled PHP warnings for PHP >= 7.3.0 to be able correct work with lowest versions of dependencies [zendframework/zend-code#160](https://github.com/zendframework/zend-code/issues/160) - Introduced support of multi line `@param` body for generated stubs - [#1968](https://github.com/phalcon/zephir/issues/1968) + [#1968](https://github.com/zephir-lang/zephir/issues/1968) ## [0.12.9] - 2019-10-14 ### Added @@ -151,19 +151,19 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Fixed - Create local `.zephir` only when necessary -- Fixed IDE stubs generation [#1778](https://github.com/phalcon/zephir/issues/1778) +- Fixed IDE stubs generation [#1778](https://github.com/zephir-lang/zephir/issues/1778) - Fixed segfault on cast `IS_UNDEF` to array - [#1941](https://github.com/phalcon/zephir/issues/1941) + [#1941](https://github.com/zephir-lang/zephir/issues/1941) - Disables some regression changes introduced in the version `0.12.5` - [#1941 (comment)](https://github.com/phalcon/zephir/issues/1941#issuecomment-538654340) -- Fixed memory leak on update array [#1937](https://github.com/phalcon/zephir/issues/1937) + [#1941 (comment)](https://github.com/zephir-lang/zephir/issues/1941#issuecomment-538654340) +- Fixed memory leak on update array [#1937](https://github.com/zephir-lang/zephir/issues/1937) - Fixed IDE stubs generation for classes that extends base classes - [#1907](https://github.com/phalcon/zephir/issues/1907) -- Proper escape slashes in strings [#1495](https://github.com/phalcon/zephir/issues/1495) + [#1907](https://github.com/zephir-lang/zephir/issues/1907) +- Proper escape slashes in strings [#1495](https://github.com/zephir-lang/zephir/issues/1495) ### Changed - Print warning during the code generation if the `timecop` extension was detected - [#1950](https://github.com/phalcon/zephir/issues/1950) + [#1950](https://github.com/zephir-lang/zephir/issues/1950) - Improved error handling to not print PHP stack traces if `ZEPHIR_DEBUG` is not set ### Removed @@ -172,38 +172,38 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.12.8] - 2019-10-03 ### Fixed - Fixed `zephir_preg_match` to use `ZVAL_NULL` instead of `ZEPHIR_NULL` - [#1946](https://github.com/phalcon/zephir/issues/1946) + [#1946](https://github.com/zephir-lang/zephir/issues/1946) - Fixed `Extension\InternalClassesTest` test to be able run full test suite - without Phalcon [#1949](https://github.com/phalcon/zephir/issues/1949) + without Phalcon [#1949](https://github.com/zephir-lang/zephir/issues/1949) ## [0.12.7] - 2019-10-03 ### Fixed - Fixed regression introduced in `0.12.5` for those users who doesn't use bundled `ext/pcre/php_pcre.h` - [#1944](https://github.com/phalcon/zephir/issues/1944) - [#1940](https://github.com/phalcon/zephir/issues/1940) -- Fixed sitemap API generator [#1940](https://github.com/phalcon/zephir/issues/1940) + [#1944](https://github.com/zephir-lang/zephir/issues/1944) + [#1940](https://github.com/zephir-lang/zephir/issues/1940) +- Fixed sitemap API generator [#1940](https://github.com/zephir-lang/zephir/issues/1940) ## [0.12.6] - 2019-10-03 ### Fixed - Fixed regression introduced in `0.12.5` for those users who doesn't use - bundled `ext/json/php_json.h` [#1940](https://github.com/phalcon/zephir/issues/1940) + bundled `ext/json/php_json.h` [#1940](https://github.com/zephir-lang/zephir/issues/1940) ## [0.12.5] - 2019-10-02 ### Changed - Update `zend_update_static_property` to be compatible with PHP >= 7.3 - [#1904](https://github.com/phalcon/zephir/issues/1904) + [#1904](https://github.com/zephir-lang/zephir/issues/1904) - Improved error handling ### Fixed - Fixed IDE stubs generation to properly generate return type hint for `var | null` - [#1922](https://github.com/phalcon/zephir/issues/1922) -- Fixed updating Super Globals [#1917](https://github.com/phalcon/zephir/issues/1917) -- Fixed casting variables to array [#1923](https://github.com/phalcon/zephir/issues/1923) + [#1922](https://github.com/zephir-lang/zephir/issues/1922) +- Fixed updating Super Globals [#1917](https://github.com/zephir-lang/zephir/issues/1917) +- Fixed casting variables to array [#1923](https://github.com/zephir-lang/zephir/issues/1923) - Fixed work with constant which are not present - [#1928](https://github.com/phalcon/zephir/issues/1928) + [#1928](https://github.com/zephir-lang/zephir/issues/1928) - Fixed access to Super Globals - [#1934](https://github.com/phalcon/zephir/issues/1934), + [#1934](https://github.com/zephir-lang/zephir/issues/1934), [phalcon/cphalcon#14426](https://github.com/phalcon/cphalcon/issues/14426) ## [0.12.4] - 2019-09-22 @@ -213,16 +213,16 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.12.3] - 2019-09-22 ### Fixed - Fixed concatenation support of strings with `double` numbers - [#1893](https://github.com/phalcon/zephir/issues/1893) + [#1893](https://github.com/zephir-lang/zephir/issues/1893) - Fixed 'void' return type hint being ignored - [#1908](https://github.com/phalcon/zephir/issues/1908) + [#1908](https://github.com/zephir-lang/zephir/issues/1908) - Fixed updating array properties - [#1915](https://github.com/phalcon/zephir/issues/1915) + [#1915](https://github.com/zephir-lang/zephir/issues/1915) ## [0.12.2] - 2019-08-05 ### Added - Introduced initial ability to generate `zend_module_deps` - [#1900](https://github.com/phalcon/zephir/pull/1900), + [#1900](https://github.com/zephir-lang/zephir/pull/1900), [phalcon/cphalcon#13702](https://github.com/phalcon/cphalcon/issues/13702), [phalcon/cphalcon#13794](https://github.com/phalcon/cphalcon/pull/13794) @@ -235,8 +235,8 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Changed - Use local memory management - [#1859](https://github.com/phalcon/zephir/pull/1859), - [#1880](https://github.com/phalcon/zephir/pull/1880) + [#1859](https://github.com/zephir-lang/zephir/pull/1859), + [#1880](https://github.com/zephir-lang/zephir/pull/1880) - Rephrase help strings for common compiler options ### Removed @@ -247,17 +247,17 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Fixed - Fixed segfault when auto-loading class with syntax error - [#1885](https://github.com/phalcon/zephir/issues/1885) -- Optimize memory usage [#1882](https://github.com/phalcon/zephir/pull/1882) + [#1885](https://github.com/zephir-lang/zephir/issues/1885) +- Optimize memory usage [#1882](https://github.com/zephir-lang/zephir/pull/1882) - Fixed modifying array values in loops - [#1879](https://github.com/phalcon/zephir/issues/1879) + [#1879](https://github.com/zephir-lang/zephir/issues/1879) ## [0.12.0] - 2019-06-20 ### Added - Added initial support of "use" keyword in closures - [#888](https://github.com/phalcon/zephir/issues/888), - [#1848](https://github.com/phalcon/zephir/issues/1848) - [#1860](https://github.com/phalcon/zephir/issues/1860) + [#888](https://github.com/zephir-lang/zephir/issues/888), + [#1848](https://github.com/zephir-lang/zephir/issues/1848) + [#1860](https://github.com/zephir-lang/zephir/issues/1860) ### Removed - PHP 5.x is no longer supported @@ -267,34 +267,34 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Fixed - Fixed CLI runner for Windows - [#1857](https://github.com/phalcon/zephir/pull/1857) + [#1857](https://github.com/zephir-lang/zephir/pull/1857) - Fixed segfault with fetching and opcache - [#1855](https://github.com/phalcon/zephir/issues/1855) + [#1855](https://github.com/zephir-lang/zephir/issues/1855) - Extended classes can't access their private variables - [#1851](https://github.com/phalcon/zephir/issues/1851) + [#1851](https://github.com/zephir-lang/zephir/issues/1851) - Incorrect usage of `zend_declare_class_constant_ex` [phalcon/cphalcon#14160](https://github.com/phalcon/cphalcon/issues/14160), https://bugs.php.net/bug.php?id=78121 - Incorrect implementation of ArrayAccess methods - [#1871](https://github.com/phalcon/zephir/pull/1871) + [#1871](https://github.com/zephir-lang/zephir/pull/1871) - Fixed exception on call undefined method - [#1863](https://github.com/phalcon/zephir/issues/1863) + [#1863](https://github.com/zephir-lang/zephir/issues/1863) ## [0.11.12] - 2019-03-24 ### Fixed -- Compilation error for instanceof [#1828](https://github.com/phalcon/zephir/issues/1828) +- Compilation error for instanceof [#1828](https://github.com/zephir-lang/zephir/issues/1828) - Fixed `array_shift` behavior to mimicry PHP's "change by reference" - [#1831](https://github.com/phalcon/zephir/issues/1831) + [#1831](https://github.com/zephir-lang/zephir/issues/1831) - Fixed reference counting while changing object's properties that are arrays - [#1833](https://github.com/phalcon/zephir/pull/1833) + [#1833](https://github.com/zephir-lang/zephir/pull/1833) ## [0.11.11] - 2019-02-26 ### Fixed - Objects are not traversable with `foreach` - [#1818](https://github.com/phalcon/zephir/issues/1818) - [#1595](https://github.com/phalcon/zephir/issues/1595) -- Recursion for array_push on PHP 7 [#1140](https://github.com/phalcon/zephir/issues/1140) -- Invalid array initialization [#1159](https://github.com/phalcon/zephir/issues/1159) + [#1818](https://github.com/zephir-lang/zephir/issues/1818) + [#1595](https://github.com/zephir-lang/zephir/issues/1595) +- Recursion for array_push on PHP 7 [#1140](https://github.com/zephir-lang/zephir/issues/1140) +- Invalid array initialization [#1159](https://github.com/zephir-lang/zephir/issues/1159) ## [0.11.10] - 2019-02-23 ### Changed @@ -308,13 +308,13 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Fixed - Array of object as return type is reported to PHP as type, not array - [#1779](https://github.com/phalcon/zephir/issues/1779) -- Use namespace as a prefix for ini name [#1604](https://github.com/phalcon/zephir/issues/1604) -- Fixed calling anonymous functions by resolving context [#1751](https://github.com/phalcon/zephir/issues/1751) + [#1779](https://github.com/zephir-lang/zephir/issues/1779) +- Use namespace as a prefix for ini name [#1604](https://github.com/zephir-lang/zephir/issues/1604) +- Fixed calling anonymous functions by resolving context [#1751](https://github.com/zephir-lang/zephir/issues/1751) - Fixed a bug when accessing super-global variables that do not exist (only for PHP >= 7.0 ) - [#1775](https://github.com/phalcon/zephir/issues/1775) -- Fixed incorrect behavior during work with ArrayAccess [#1061](https://github.com/phalcon/zephir/issues/1061), - [#1400](https://github.com/phalcon/zephir/issues/1400) + [#1775](https://github.com/zephir-lang/zephir/issues/1775) +- Fixed incorrect behavior during work with ArrayAccess [#1061](https://github.com/zephir-lang/zephir/issues/1061), + [#1400](https://github.com/zephir-lang/zephir/issues/1400) ## [0.11.9] - 2019-01-15 - Fixed `zend_closure` declaration to reflect PHP 7.3 changes @@ -322,9 +322,9 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.11.8] - 2018-12-01 ### Fixed - Fixed compilation error with inheritance of prototype interfaces - [#1758](https://github.com/phalcon/zephir/issues/1758) + [#1758](https://github.com/zephir-lang/zephir/issues/1758) - Fixed compilation error when a new file is added or removed to the project - [#1776](https://github.com/phalcon/zephir/issues/1776) + [#1776](https://github.com/zephir-lang/zephir/issues/1776) ## [0.11.7] - 2018-11-27 ### Changed @@ -335,7 +335,7 @@ and this project adheres to [Semantic Versioning](http://semver.org). - The compiler's messages was divided into streams. Thus, now it is possible to redirect compiler's output as follows: `zephir generate 2> errors.log 1> /dev/null` - Fixed type hints for scalar arguments for PHP < 7.2 - [#1658](https://github.com/phalcon/zephir/pull/1658) + [#1658](https://github.com/zephir-lang/zephir/pull/1658) - Coloring the compiler messages in the terminal is temporarily disabled ### Fixed @@ -344,9 +344,9 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.11.6] - 2018-11-19 ### Fixed - Fixed incorrect behavior of `require` statement for ZendEngine3 - [#1621](https://github.com/phalcon/zephir/issues/1621) - [#1403](https://github.com/phalcon/zephir/issues/1403) - [#1428](https://github.com/phalcon/zephir/pull/1428) + [#1621](https://github.com/zephir-lang/zephir/issues/1621) + [#1403](https://github.com/zephir-lang/zephir/issues/1403) + [#1428](https://github.com/zephir-lang/zephir/pull/1428) ## [0.11.4] - 2018-11-18 ### Added @@ -354,20 +354,20 @@ and this project adheres to [Semantic Versioning](http://semver.org). - The preferred method of installation is to use the Zephir PHAR which can be downloaded from the most recent Github Release - Added `--no-dev` option to force building the extension in production mode - [#1520](https://github.com/phalcon/zephir/issues/1520) + [#1520](https://github.com/zephir-lang/zephir/issues/1520) - Zephir development mode will be enabled silently if your PHP binary was compiled in - a debug configuration [#1520](https://github.com/phalcon/zephir/issues/1520) + a debug configuration [#1520](https://github.com/zephir-lang/zephir/issues/1520) - Added missed CLI option `--export-classes` to flag whether classes must be exported. If export-classes is enabled all headers are copied to `include/php/ext`. ### Fixed - Fixed regression introduced in the 0.10.12 related to `require` file using protocols - [#1713](https://github.com/phalcon/zephir/issues/1713) + [#1713](https://github.com/zephir-lang/zephir/issues/1713) ## [0.11.3] - 2018-11-13 ### Changed - Remove legacy installers and provide a common way to install Zephir - [#1714](https://github.com/phalcon/zephir/issues/1714). Supported installation strategies are: + [#1714](https://github.com/zephir-lang/zephir/issues/1714). Supported installation strategies are: - Install as a global application (using `composer global require`) - Install as a PHAR file. (this feature currently in the testing phase and not released officially) - Install as a Git clone (using `git clone` and `composer install` inside cloned project) @@ -394,7 +394,7 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.11.0] - 2018-08-05 ### Added - Add type hints for scalar arguments and return values in ZendEngine 3 - [1656](https://github.com/phalcon/zephir/issues/1656) + [1656](https://github.com/zephir-lang/zephir/issues/1656) ## [0.10.14] - 2018-11-20 ### Fixed @@ -404,11 +404,11 @@ and this project adheres to [Semantic Versioning](http://semver.org). ## [0.10.13] - 2018-11-18 ### Fixed - Fixed regression introduced in the 0.10.12 related to `require` file using protocols - [#1713](https://github.com/phalcon/zephir/issues/1713) (backported from the upstream) + [#1713](https://github.com/zephir-lang/zephir/issues/1713) (backported from the upstream) - Fixed incorrect behavior of `require` statement for ZendEngine3 - [#1621](https://github.com/phalcon/zephir/issues/1621) - [#1403](https://github.com/phalcon/zephir/issues/1403) - [#1428](https://github.com/phalcon/zephir/pull/1428) + [#1621](https://github.com/zephir-lang/zephir/issues/1621) + [#1403](https://github.com/zephir-lang/zephir/issues/1403) + [#1428](https://github.com/zephir-lang/zephir/pull/1428) (backported from the upstream) ## [0.10.12] - 2018-10-19 @@ -422,46 +422,46 @@ and this project adheres to [Semantic Versioning](http://semver.org). ### Fixed - Fixed [Copy-On-Write](https://en.wikipedia.org/wiki/Copy-on-write) violation for arrays zvals - Fixed some testing settings - [5deb64a](https://github.com/phalcon/zephir/commit/5deb64a8a1c7c18d45ce1a5a55667c499e2c284f) + [5deb64a](https://github.com/zephir-lang/zephir/commit/5deb64a8a1c7c18d45ce1a5a55667c499e2c284f) - Fixed casting resource to int (only ZendEngine 3) - [#1524](https://github.com/phalcon/zephir/issues/1524) - -[Unreleased]: https://github.com/phalcon/zephir/compare/0.12.21...HEAD -[0.12.21]: https://github.com/phalcon/zephir/compare/0.12.20...0.12.21 -[0.12.20]: https://github.com/phalcon/zephir/compare/0.12.19...0.12.20 -[0.12.19]: https://github.com/phalcon/zephir/compare/0.12.18...0.12.19 -[0.12.18]: https://github.com/phalcon/zephir/compare/0.12.17...0.12.18 -[0.12.17]: https://github.com/phalcon/zephir/compare/0.12.16...0.12.17 -[0.12.16]: https://github.com/phalcon/zephir/compare/0.12.15...0.12.16 -[0.12.15]: https://github.com/phalcon/zephir/compare/0.12.14...0.12.15 -[0.12.14]: https://github.com/phalcon/zephir/compare/0.12.13...0.12.14 -[0.12.13]: https://github.com/phalcon/zephir/compare/0.12.12...0.12.13 -[0.12.12]: https://github.com/phalcon/zephir/compare/0.12.11...0.12.12 -[0.12.11]: https://github.com/phalcon/zephir/compare/0.12.10...0.12.11 -[0.12.10]: https://github.com/phalcon/zephir/compare/0.12.9...0.12.10 -[0.12.9]: https://github.com/phalcon/zephir/compare/0.12.8...0.12.9 -[0.12.8]: https://github.com/phalcon/zephir/compare/0.12.7...0.12.8 -[0.12.7]: https://github.com/phalcon/zephir/compare/0.12.6...0.12.7 -[0.12.6]: https://github.com/phalcon/zephir/compare/0.12.5...0.12.6 -[0.12.5]: https://github.com/phalcon/zephir/compare/0.12.4...0.12.5 -[0.12.4]: https://github.com/phalcon/zephir/compare/0.12.3...0.12.4 -[0.12.3]: https://github.com/phalcon/zephir/compare/0.12.2...0.12.3 -[0.12.2]: https://github.com/phalcon/zephir/compare/0.12.1...0.12.2 -[0.12.1]: https://github.com/phalcon/zephir/compare/0.12.0...0.12.1 -[0.12.0]: https://github.com/phalcon/zephir/compare/0.11.12...0.12.0 -[0.11.12]: https://github.com/phalcon/zephir/compare/0.11.11...0.11.12 -[0.11.11]: https://github.com/phalcon/zephir/compare/0.11.10...0.11.11 -[0.11.10]: https://github.com/phalcon/zephir/compare/0.11.9...0.11.10 -[0.11.9]: https://github.com/phalcon/zephir/compare/0.11.8...0.11.9 -[0.11.8]: https://github.com/phalcon/zephir/compare/0.11.7...0.11.8 -[0.11.7]: https://github.com/phalcon/zephir/compare/0.11.6...0.11.7 -[0.11.6]: https://github.com/phalcon/zephir/compare/0.11.4...0.11.6 -[0.11.4]: https://github.com/phalcon/zephir/compare/0.11.3...0.11.4 -[0.11.3]: https://github.com/phalcon/zephir/compare/0.11.2...0.11.3 -[0.11.2]: https://github.com/phalcon/zephir/compare/0.11.1...0.11.2 -[0.11.1]: https://github.com/phalcon/zephir/compare/0.11.0...0.11.1 -[0.11.0]: https://github.com/phalcon/zephir/compare/0.10.14...0.11.0 -[0.10.14]: https://github.com/phalcon/zephir/compare/0.10.13...0.10.4 -[0.10.13]: https://github.com/phalcon/zephir/compare/0.10.12...0.10.13 -[0.10.12]: https://github.com/phalcon/zephir/compare/0.10.11...0.10.12 -[0.10.11]: https://github.com/phalcon/zephir/compare/0.10.10...0.10.11 + [#1524](https://github.com/zephir-lang/zephir/issues/1524) + +[Unreleased]: https://github.com/zephir-lang/zephir/compare/0.12.21...HEAD +[0.12.21]: https://github.com/zephir-lang/zephir/compare/0.12.20...0.12.21 +[0.12.20]: https://github.com/zephir-lang/zephir/compare/0.12.19...0.12.20 +[0.12.19]: https://github.com/zephir-lang/zephir/compare/0.12.18...0.12.19 +[0.12.18]: https://github.com/zephir-lang/zephir/compare/0.12.17...0.12.18 +[0.12.17]: https://github.com/zephir-lang/zephir/compare/0.12.16...0.12.17 +[0.12.16]: https://github.com/zephir-lang/zephir/compare/0.12.15...0.12.16 +[0.12.15]: https://github.com/zephir-lang/zephir/compare/0.12.14...0.12.15 +[0.12.14]: https://github.com/zephir-lang/zephir/compare/0.12.13...0.12.14 +[0.12.13]: https://github.com/zephir-lang/zephir/compare/0.12.12...0.12.13 +[0.12.12]: https://github.com/zephir-lang/zephir/compare/0.12.11...0.12.12 +[0.12.11]: https://github.com/zephir-lang/zephir/compare/0.12.10...0.12.11 +[0.12.10]: https://github.com/zephir-lang/zephir/compare/0.12.9...0.12.10 +[0.12.9]: https://github.com/zephir-lang/zephir/compare/0.12.8...0.12.9 +[0.12.8]: https://github.com/zephir-lang/zephir/compare/0.12.7...0.12.8 +[0.12.7]: https://github.com/zephir-lang/zephir/compare/0.12.6...0.12.7 +[0.12.6]: https://github.com/zephir-lang/zephir/compare/0.12.5...0.12.6 +[0.12.5]: https://github.com/zephir-lang/zephir/compare/0.12.4...0.12.5 +[0.12.4]: https://github.com/zephir-lang/zephir/compare/0.12.3...0.12.4 +[0.12.3]: https://github.com/zephir-lang/zephir/compare/0.12.2...0.12.3 +[0.12.2]: https://github.com/zephir-lang/zephir/compare/0.12.1...0.12.2 +[0.12.1]: https://github.com/zephir-lang/zephir/compare/0.12.0...0.12.1 +[0.12.0]: https://github.com/zephir-lang/zephir/compare/0.11.12...0.12.0 +[0.11.12]: https://github.com/zephir-lang/zephir/compare/0.11.11...0.11.12 +[0.11.11]: https://github.com/zephir-lang/zephir/compare/0.11.10...0.11.11 +[0.11.10]: https://github.com/zephir-lang/zephir/compare/0.11.9...0.11.10 +[0.11.9]: https://github.com/zephir-lang/zephir/compare/0.11.8...0.11.9 +[0.11.8]: https://github.com/zephir-lang/zephir/compare/0.11.7...0.11.8 +[0.11.7]: https://github.com/zephir-lang/zephir/compare/0.11.6...0.11.7 +[0.11.6]: https://github.com/zephir-lang/zephir/compare/0.11.4...0.11.6 +[0.11.4]: https://github.com/zephir-lang/zephir/compare/0.11.3...0.11.4 +[0.11.3]: https://github.com/zephir-lang/zephir/compare/0.11.2...0.11.3 +[0.11.2]: https://github.com/zephir-lang/zephir/compare/0.11.1...0.11.2 +[0.11.1]: https://github.com/zephir-lang/zephir/compare/0.11.0...0.11.1 +[0.11.0]: https://github.com/zephir-lang/zephir/compare/0.10.14...0.11.0 +[0.10.14]: https://github.com/zephir-lang/zephir/compare/0.10.13...0.10.4 +[0.10.13]: https://github.com/zephir-lang/zephir/compare/0.10.12...0.10.13 +[0.10.12]: https://github.com/zephir-lang/zephir/compare/0.10.11...0.10.12 +[0.10.11]: https://github.com/zephir-lang/zephir/compare/0.10.10...0.10.11 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3119aa7f48..4360a464bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,7 +80,7 @@ Thanks!
Phalcon Team [team]: https://phalcon.io/en-us/team -[issues]: https://github.com/phalcon/zephir/issues +[issues]: https://github.com/zephir-lang/zephir/issues [docs]: https://docs.zephir-lang.com [git rebase]: http://git-scm.com/book/en/Git-Branching-Rebasing [psr-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md diff --git a/Library/Backends/ZendEngine3/VariablesManager.php b/Library/Backends/ZendEngine3/VariablesManager.php index 8e3e2df93a..00980b7ffa 100644 --- a/Library/Backends/ZendEngine3/VariablesManager.php +++ b/Library/Backends/ZendEngine3/VariablesManager.php @@ -64,7 +64,7 @@ public function initializeDefaults(Variable $variable, array $value, Context $co private function initDynamicVar(Variable $variable, array $value, Context $context) { /* These ones are system variables, do not add default values. - Also see: https://github.com/phalcon/zephir/issues/1660 */ + Also see: https://github.com/zephir-lang/zephir/issues/1660 */ if (\in_array($variable->getName(), self::RESERVED_NAMES, true)) { return; } diff --git a/Library/ClassMethodParameters.php b/Library/ClassMethodParameters.php index da3f28f002..b5d29d7f4c 100644 --- a/Library/ClassMethodParameters.php +++ b/Library/ClassMethodParameters.php @@ -37,7 +37,7 @@ public function __construct(array $parameters) if (isset($parameter['reference']) && $parameter['reference']) { throw new CompilerException( 'Zephir not support reference parameters for now. '. - 'Stay tuned for https://github.com/phalcon/zephir/issues/203', + 'Stay tuned for https://github.com/zephir-lang/zephir/issues/203', $parameter ); } diff --git a/Library/Console/Command/GenerateCommand.php b/Library/Console/Command/GenerateCommand.php index 2db8d42c97..0825fef883 100644 --- a/Library/Console/Command/GenerateCommand.php +++ b/Library/Console/Command/GenerateCommand.php @@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output) For more see: -- https://github.com/phalcon/zephir/issues/1950 +- https://github.com/zephir-lang/zephir/issues/1950 - https://github.com/phalcon/cphalcon/issues/13117 MSG ); diff --git a/Library/Operators/Other/CastOperator.php b/Library/Operators/Other/CastOperator.php index 1ad3ca90a1..ed1b5a133c 100644 --- a/Library/Operators/Other/CastOperator.php +++ b/Library/Operators/Other/CastOperator.php @@ -514,7 +514,7 @@ public function compile(array $expression, CompilationContext $compilationContex default: // TODO: I'm not a pretty sure this branch works // This is old code I just moved to "default" - // See: https://github.com/phalcon/zephir/issues/1988 + // See: https://github.com/zephir-lang/zephir/issues/1988 $symbolVariable = $compilationContext->symbolTable->getTempVariable( 'string', $compilationContext diff --git a/Library/Stubs/Generator.php b/Library/Stubs/Generator.php index 8fb4279b2e..db4feba6e7 100644 --- a/Library/Stubs/Generator.php +++ b/Library/Stubs/Generator.php @@ -305,8 +305,8 @@ protected function buildMethod(ClassMethod $method, bool $isInterface, string $i /** * TODO: Add $method->isVoid() check after removing PHP 7.0 support. * - * @see https://github.com/phalcon/zephir/issues/1977 - * @see https://github.com/phalcon/zephir/pull/1978 + * @see https://github.com/zephir-lang/zephir/issues/1977 + * @see https://github.com/zephir-lang/zephir/pull/1978 */ if (version_compare(PHP_VERSION, '7.0.0', '>=') && $method->hasReturnTypes()) { $supported = 0; diff --git a/README.md b/README.md index cfefec6e92..fe19e49153 100644 --- a/README.md +++ b/README.md @@ -47,14 +47,14 @@ Support us with a monthly donation and help us continue our activities. Zephir licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information. [docs]: https://docs.zephir-lang.com -[zephir]: https://github.com/phalcon/zephir +[zephir]: https://github.com/zephir-lang/zephir [facebook]: https://www.facebook.com/groups/zephir.language [discord]: https://phalcon.link/discord [zephir logo]: https://assets.phalconphp.com/zephir/zephir_logo-105x36.svg [web site]: https://zephir-lang.com -[actions link]: https://github.com/phalcon/zephir/actions -[actions unix]: https://github.com/phalcon/zephir/workflows/Unix%20CI/badge.svg -[actions windows]: https://github.com/phalcon/zephir/workflows/Windows%20CI/badge.svg +[actions link]: https://github.com/zephir-lang/zephir/actions +[actions unix]: https://github.com/zephir-lang/zephir/workflows/Unix%20CI/badge.svg +[actions windows]: https://github.com/zephir-lang/zephir/workflows/Windows%20CI/badge.svg [version badge]: https://poser.pugx.org/phalcon/zephir/v/stable.svg [packagist link]: https://packagist.org/packages/phalcon/zephir [license badge]: https://poser.pugx.org/phalcon/zephir/license.svg diff --git a/composer.json b/composer.json index 53fd25bf9d..fca4b66ffc 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/phalcon/zephir/graphs/contributors" + "homepage": "https://github.com/zephir-lang/zephir/graphs/contributors" } ], "require": { @@ -83,8 +83,8 @@ "zephir" ], "support": { - "issues": "https://github.com/phalcon/zephir/issues?state=open", - "source": "https://github.com/phalcon/zephir", + "issues": "https://github.com/zephir-lang/zephir/issues?state=open", + "source": "https://github.com/zephir-lang/zephir", "irc": "irc://irc.freenode.net/zephir", "docs": "https://docs.zephir-lang.com" } diff --git a/ext/stub/arraysearch.zep.c b/ext/stub/arraysearch.zep.c index 8f0f69b33c..f24372bd3f 100644 --- a/ext/stub/arraysearch.zep.c +++ b/ext/stub/arraysearch.zep.c @@ -27,7 +27,7 @@ ZEPHIR_INIT_CLASS(Stub_ArraySearch) { } -/** @issue https://github.com/phalcon/zephir/issues/1609 */ +/** @issue https://github.com/zephir-lang/zephir/issues/1609 */ PHP_METHOD(Stub_ArraySearch, simpleSearch) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; @@ -70,7 +70,7 @@ PHP_METHOD(Stub_ArraySearch, simpleSearch) { } -/** @issue https://github.com/phalcon/zephir/issues/1609 */ +/** @issue https://github.com/zephir-lang/zephir/issues/1609 */ PHP_METHOD(Stub_ArraySearch, searchUsingArrayInsideZephir) { zval _0, pos; diff --git a/ext/stub/assign.zep.c b/ext/stub/assign.zep.c index cd009f3de8..499bd139f0 100644 --- a/ext/stub/assign.zep.c +++ b/ext/stub/assign.zep.c @@ -694,7 +694,7 @@ PHP_METHOD(Stub_Assign, testAssign40) { } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ PHP_METHOD(Stub_Assign, testAssign41) { @@ -723,7 +723,7 @@ PHP_METHOD(Stub_Assign, testAssign41) { } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ PHP_METHOD(Stub_Assign, testAssign42) { @@ -2446,7 +2446,7 @@ PHP_METHOD(Stub_Assign, testArrayProperty) { } /** - * @link https://github.com/phalcon/zephir/issues/159 + * @link https://github.com/zephir-lang/zephir/issues/159 */ PHP_METHOD(Stub_Assign, testGlobalVarAssign) { @@ -2476,7 +2476,7 @@ PHP_METHOD(Stub_Assign, testGlobalVarAssign) { } /** - * @link https://github.com/phalcon/zephir/issues/523 + * @link https://github.com/zephir-lang/zephir/issues/523 */ PHP_METHOD(Stub_Assign, testConstantKeyAssign) { @@ -2499,7 +2499,7 @@ PHP_METHOD(Stub_Assign, testConstantKeyAssign) { } /** - * @link https://github.com/phalcon/zephir/issues/746 + * @link https://github.com/zephir-lang/zephir/issues/746 * */ PHP_METHOD(Stub_Assign, testArrayBoolExpressionAssign) { @@ -2538,7 +2538,7 @@ PHP_METHOD(Stub_Assign, testArrayBoolExpressionAssign) { } /** - * @link https://github.com/phalcon/zephir/issues/725 + * @link https://github.com/zephir-lang/zephir/issues/725 */ PHP_METHOD(Stub_Assign, testAssignSuperGlobals) { @@ -2577,7 +2577,7 @@ PHP_METHOD(Stub_Assign, testAssignSuperGlobals) { } /** - * @link https://github.com/phalcon/zephir/issues/1917 + * @link https://github.com/zephir-lang/zephir/issues/1917 */ PHP_METHOD(Stub_Assign, testAssignSuperGlobalsSERVER) { @@ -2606,7 +2606,7 @@ PHP_METHOD(Stub_Assign, testAssignSuperGlobalsSERVER) { } /** - * @link https://github.com/phalcon/zephir/issues/1917 + * @link https://github.com/zephir-lang/zephir/issues/1917 */ PHP_METHOD(Stub_Assign, testAssignSuperGlobalsGET) { diff --git a/ext/stub/bitwise.zep.c b/ext/stub/bitwise.zep.c index 81e81d18bc..f084842d7c 100644 --- a/ext/stub/bitwise.zep.c +++ b/ext/stub/bitwise.zep.c @@ -1569,7 +1569,7 @@ PHP_METHOD(Stub_Bitwise, getInt) { } /** - * @issue https://github.com/phalcon/zephir/issues/1581 + * @issue https://github.com/zephir-lang/zephir/issues/1581 */ PHP_METHOD(Stub_Bitwise, testbitwiseXor) { diff --git a/ext/stub/cast.zep.c b/ext/stub/cast.zep.c index 2f4e6c2817..987d194bf7 100644 --- a/ext/stub/cast.zep.c +++ b/ext/stub/cast.zep.c @@ -30,7 +30,7 @@ ZEPHIR_INIT_CLASS(Stub_Cast) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testCharCastFromChar) { @@ -43,7 +43,7 @@ PHP_METHOD(Stub_Cast, testCharCastFromChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testCharCastFromVariableChar) { @@ -60,7 +60,7 @@ PHP_METHOD(Stub_Cast, testCharCastFromVariableChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testStringCastChar) { @@ -73,7 +73,7 @@ PHP_METHOD(Stub_Cast, testStringCastChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testStringCastVariableChar) { @@ -118,7 +118,7 @@ PHP_METHOD(Stub_Cast, testIntCastFromVariableFloat) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testIntCastFromChar) { @@ -131,7 +131,7 @@ PHP_METHOD(Stub_Cast, testIntCastFromChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testIntCastFromVariableChar) { @@ -419,7 +419,7 @@ PHP_METHOD(Stub_Cast, testIntCastFromVariableStdClass) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testLongCastFromChar) { @@ -432,7 +432,7 @@ PHP_METHOD(Stub_Cast, testLongCastFromChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testLongCastFromVariableChar) { @@ -681,7 +681,7 @@ PHP_METHOD(Stub_Cast, testFloatCastFromVariableStdClass) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testDoubleCastFromVChar) { @@ -694,7 +694,7 @@ PHP_METHOD(Stub_Cast, testDoubleCastFromVChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testDoubleCastFromVariableChar) { @@ -821,7 +821,7 @@ PHP_METHOD(Stub_Cast, testBooleanCastFromNull) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testBooleanCastFromChar) { @@ -834,7 +834,7 @@ PHP_METHOD(Stub_Cast, testBooleanCastFromChar) { } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ PHP_METHOD(Stub_Cast, testBooleanCastFromVariableChar) { diff --git a/ext/stub/compare.zep.c b/ext/stub/compare.zep.c index bcde08a54a..dbbe03c00e 100644 --- a/ext/stub/compare.zep.c +++ b/ext/stub/compare.zep.c @@ -156,7 +156,7 @@ PHP_METHOD(Stub_Compare, isMoreThenPi) { } /** - * @link https://github.com/phalcon/zephir/issues/411 + * @link https://github.com/zephir-lang/zephir/issues/411 */ PHP_METHOD(Stub_Compare, testVarWithStringEquals) { diff --git a/ext/stub/concat.zep.c b/ext/stub/concat.zep.c index 590289f226..42e6767114 100644 --- a/ext/stub/concat.zep.c +++ b/ext/stub/concat.zep.c @@ -126,7 +126,7 @@ PHP_METHOD(Stub_Concat, testConcat2) { } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ PHP_METHOD(Stub_Concat, testConcat3) { @@ -150,7 +150,7 @@ PHP_METHOD(Stub_Concat, testConcat3) { } /** - * @link https://github.com/phalcon/zephir/issues/1893 + * @link https://github.com/zephir-lang/zephir/issues/1893 */ PHP_METHOD(Stub_Concat, testConcat4) { @@ -199,7 +199,7 @@ PHP_METHOD(Stub_Concat, testConcat4) { } /** - * @link https://github.com/phalcon/zephir/issues/1893 + * @link https://github.com/zephir-lang/zephir/issues/1893 */ PHP_METHOD(Stub_Concat, testConcat5) { diff --git a/ext/stub/constants.zep.c b/ext/stub/constants.zep.c index c6221e1716..35a306b174 100644 --- a/ext/stub/constants.zep.c +++ b/ext/stub/constants.zep.c @@ -304,7 +304,7 @@ PHP_METHOD(Stub_Constants, testPHPVersionEnvConstantInExpValue) { /** * Test Delimiters as String Constants * - * @link https://github.com/phalcon/zephir/issues/1571 + * @link https://github.com/zephir-lang/zephir/issues/1571 */ PHP_METHOD(Stub_Constants, testStringDelimiterConstantDoubleQuoted) { diff --git a/ext/stub/exception.zep.c b/ext/stub/exception.zep.c index c5c62f18ac..43f339c805 100644 --- a/ext/stub/exception.zep.c +++ b/ext/stub/exception.zep.c @@ -31,7 +31,7 @@ ZEPHIR_INIT_CLASS(Stub_Exception) { } /** - * @link https://github.com/phalcon/zephir/issues/915 + * @link https://github.com/zephir-lang/zephir/issues/915 */ PHP_METHOD(Stub_Exception, testRuntimePropertyFetch) { diff --git a/ext/stub/functions.zep.c b/ext/stub/functions.zep.c index eef040da4c..9b29b99764 100644 --- a/ext/stub/functions.zep.c +++ b/ext/stub/functions.zep.c @@ -27,7 +27,7 @@ ZEPHIR_INIT_CLASS(Stub_Functions) { } /** - * @issue https://github.com/phalcon/zephir/issues/658 + * @issue https://github.com/zephir-lang/zephir/issues/658 */ PHP_METHOD(Stub_Functions, filterVar1) { @@ -55,7 +55,7 @@ PHP_METHOD(Stub_Functions, filterVar1) { } /** - * @issue https://github.com/phalcon/zephir/issues/658 + * @issue https://github.com/zephir-lang/zephir/issues/658 */ PHP_METHOD(Stub_Functions, filterVar2) { diff --git a/ext/stub/globals/post.zep.c b/ext/stub/globals/post.zep.c index b9d00e2230..32a4552d06 100644 --- a/ext/stub/globals/post.zep.c +++ b/ext/stub/globals/post.zep.c @@ -29,7 +29,7 @@ ZEPHIR_INIT_CLASS(Stub_Globals_Post) { /** * Tests "Invalid superglobal for _POST" * - * @issue https://github.com/phalcon/zephir/issues/1623 + * @issue https://github.com/zephir-lang/zephir/issues/1623 */ PHP_METHOD(Stub_Globals_Post, hasValue) { diff --git a/ext/stub/globals/server.zep.c b/ext/stub/globals/server.zep.c index 0da3bda045..11a53edec3 100644 --- a/ext/stub/globals/server.zep.c +++ b/ext/stub/globals/server.zep.c @@ -27,7 +27,7 @@ ZEPHIR_INIT_CLASS(Stub_Globals_Server) { } /** - * @see https://github.com/phalcon/zephir/issues/1961 + * @see https://github.com/zephir-lang/zephir/issues/1961 */ PHP_METHOD(Stub_Globals_Server, f1) { @@ -71,7 +71,7 @@ PHP_METHOD(Stub_Globals_Server, f2) { } /** - * @see https://github.com/phalcon/zephir/issues/1970 + * @see https://github.com/zephir-lang/zephir/issues/1970 */ PHP_METHOD(Stub_Globals_Server, check) { diff --git a/ext/stub/globals/serverrequestfactory.zep.c b/ext/stub/globals/serverrequestfactory.zep.c index d26a8d31b8..2e18d0f26b 100644 --- a/ext/stub/globals/serverrequestfactory.zep.c +++ b/ext/stub/globals/serverrequestfactory.zep.c @@ -28,7 +28,7 @@ ZEPHIR_INIT_CLASS(Stub_Globals_ServerRequestFactory) { } /** - * @link https://github.com/phalcon/zephir/issues/1934 + * @link https://github.com/zephir-lang/zephir/issues/1934 */ PHP_METHOD(Stub_Globals_ServerRequestFactory, load) { diff --git a/ext/stub/mcall.zep.c b/ext/stub/mcall.zep.c index 1c9daa4419..706a17d4af 100644 --- a/ext/stub/mcall.zep.c +++ b/ext/stub/mcall.zep.c @@ -1052,7 +1052,7 @@ PHP_METHOD(Stub_Mcall, optionalParameterBooleanNull) { } /** - * @link https://github.com/phalcon/zephir/issues/142 + * @link https://github.com/zephir-lang/zephir/issues/142 */ PHP_METHOD(Stub_Mcall, testArrayParamWithDefaultEmptyArray) { diff --git a/ext/stub/mcalldynamic.zep.c b/ext/stub/mcalldynamic.zep.c index 2185e0acfb..c78bc20d6d 100644 --- a/ext/stub/mcalldynamic.zep.c +++ b/ext/stub/mcalldynamic.zep.c @@ -96,7 +96,7 @@ PHP_METHOD(Stub_McallDynamic, __call) { } /** - * @link https://github.com/phalcon/zephir/issues/1751 + * @link https://github.com/zephir-lang/zephir/issues/1751 */ PHP_METHOD(Stub_McallDynamic, testCallAnonymousFunctionWithContext) { diff --git a/ext/stub/methodargs.zep.c b/ext/stub/methodargs.zep.c index c4cf1f1663..3743e63737 100644 --- a/ext/stub/methodargs.zep.c +++ b/ext/stub/methodargs.zep.c @@ -165,7 +165,7 @@ PHP_METHOD(Stub_MethodArgs, setResourceStrict) { } /** - * @link https://github.com/phalcon/zephir/issues/336 + * @link https://github.com/zephir-lang/zephir/issues/336 */ PHP_METHOD(Stub_MethodArgs, methodOptionalValueWithDefaultStaticConstantAccess) { @@ -201,7 +201,7 @@ PHP_METHOD(Stub_MethodArgs, methodOptionalValueWithDefaultStaticConstantAccess) /** * For string parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ PHP_METHOD(Stub_MethodArgs, methodOptionalStringValueWithDefaultStaticConstantAccess) { @@ -238,7 +238,7 @@ PHP_METHOD(Stub_MethodArgs, methodOptionalStringValueWithDefaultStaticConstantAc /** * For double parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ PHP_METHOD(Stub_MethodArgs, methodOptionalDoubleValueWithDefaultStaticConstantAccess) { @@ -271,7 +271,7 @@ PHP_METHOD(Stub_MethodArgs, methodOptionalDoubleValueWithDefaultStaticConstantAc /** * For bool parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ PHP_METHOD(Stub_MethodArgs, methodOptionalBoolValueWithDefaultStaticConstantAccess) { @@ -304,7 +304,7 @@ PHP_METHOD(Stub_MethodArgs, methodOptionalBoolValueWithDefaultStaticConstantAcce /** * For int parameter - * @link https://github.com/phalcon/zephir/issues/728 + * @link https://github.com/zephir-lang/zephir/issues/728 */ PHP_METHOD(Stub_MethodArgs, methodOptionalIntValueWithDefaultStaticConstantAccess) { diff --git a/ext/stub/nativearray.zep.c b/ext/stub/nativearray.zep.c index cb4f165ce8..333e5cc8c3 100644 --- a/ext/stub/nativearray.zep.c +++ b/ext/stub/nativearray.zep.c @@ -1852,7 +1852,7 @@ PHP_METHOD(Stub_NativeArray, testImplodeArray) { } /** - * @link https://github.com/phalcon/zephir/issues/110 + * @link https://github.com/zephir-lang/zephir/issues/110 */ PHP_METHOD(Stub_NativeArray, issue110) { @@ -2008,7 +2008,7 @@ PHP_METHOD(Stub_NativeArray, issue743c) { } /** - * @link https://github.com/phalcon/zephir/issues/709 + * @link https://github.com/zephir-lang/zephir/issues/709 */ PHP_METHOD(Stub_NativeArray, issue709) { diff --git a/ext/stub/oo/propertyaccess.zep.c b/ext/stub/oo/propertyaccess.zep.c index 664f79ba3b..1f87ff0ed2 100644 --- a/ext/stub/oo/propertyaccess.zep.c +++ b/ext/stub/oo/propertyaccess.zep.c @@ -107,7 +107,7 @@ PHP_METHOD(Stub_Oo_PropertyAccess, __construct) { } /** - * @issue https://github.com/phalcon/zephir/issues/1851 + * @issue https://github.com/zephir-lang/zephir/issues/1851 */ PHP_METHOD(Stub_Oo_PropertyAccess, setPrivatevariable) { @@ -134,7 +134,7 @@ PHP_METHOD(Stub_Oo_PropertyAccess, setPrivatevariable) { } /** - * @issue https://github.com/phalcon/zephir/issues/1851 + * @issue https://github.com/zephir-lang/zephir/issues/1851 */ PHP_METHOD(Stub_Oo_PropertyAccess, getPrivatevariable) { diff --git a/ext/stub/oo/scopes/privatescopetester.zep.c b/ext/stub/oo/scopes/privatescopetester.zep.c index da89d9587f..3cdeca7c4a 100644 --- a/ext/stub/oo/scopes/privatescopetester.zep.c +++ b/ext/stub/oo/scopes/privatescopetester.zep.c @@ -44,7 +44,7 @@ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, run) { } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, setPropertyObj) { @@ -83,7 +83,7 @@ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, setPropertyObj) { } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, setPropertyNew) { @@ -124,7 +124,7 @@ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, setPropertyNew) { } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, getObjVars) { @@ -155,7 +155,7 @@ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, getObjVars) { } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ PHP_METHOD(Stub_Oo_Scopes_PrivateScopeTester, getNewVars) { diff --git a/ext/stub/optimizers/strreplace.zep.c b/ext/stub/optimizers/strreplace.zep.c index e432776f82..33aa49de50 100644 --- a/ext/stub/optimizers/strreplace.zep.c +++ b/ext/stub/optimizers/strreplace.zep.c @@ -28,7 +28,7 @@ ZEPHIR_INIT_CLASS(Stub_Optimizers_StrReplace) { } /** - * @link https://github.com/phalcon/zephir/issues/1055 + * @link https://github.com/zephir-lang/zephir/issues/1055 */ PHP_METHOD(Stub_Optimizers_StrReplace, issue1055) { diff --git a/ext/stub/pregmatch.zep.c b/ext/stub/pregmatch.zep.c index 67840748fd..e66821f69c 100644 --- a/ext/stub/pregmatch.zep.c +++ b/ext/stub/pregmatch.zep.c @@ -278,7 +278,7 @@ PHP_METHOD(Stub_Pregmatch, testPregMatch5Params) { } /** - * @link https://github.com/phalcon/zephir/issues/287 + * @link https://github.com/zephir-lang/zephir/issues/287 */ PHP_METHOD(Stub_Pregmatch, testPregMatchSaveMatches) { diff --git a/ext/stub/properties/propertyarray.zep.c b/ext/stub/properties/propertyarray.zep.c index a37fbf6f65..4db91c769a 100644 --- a/ext/stub/properties/propertyarray.zep.c +++ b/ext/stub/properties/propertyarray.zep.c @@ -20,7 +20,7 @@ /** - * @link https://github.com/phalcon/zephir/issues/520 + * @link https://github.com/zephir-lang/zephir/issues/520 */ ZEPHIR_INIT_CLASS(Stub_Properties_PropertyArray) { diff --git a/ext/stub/properties/publicproperties.zep.c b/ext/stub/properties/publicproperties.zep.c index 919d567de2..947829779d 100644 --- a/ext/stub/properties/publicproperties.zep.c +++ b/ext/stub/properties/publicproperties.zep.c @@ -69,13 +69,13 @@ ZEPHIR_INIT_CLASS(Stub_Properties_PublicProperties) { /** * It's needed to test ide stubs - * @link https://github.com/phalcon/zephir/issues/731 + * @link https://github.com/zephir-lang/zephir/issues/731 */ zend_declare_property_null(stub_properties_publicproperties_ce, SL("someArrayWithSpecifyKeys"), ZEND_ACC_PROTECTED); /** * It's needed to test ide stubs - * @link https://github.com/phalcon/zephir/issues/731 + * @link https://github.com/zephir-lang/zephir/issues/731 */ zend_declare_property_null(stub_properties_publicproperties_ce, SL("someArrayWithSubArray"), ZEND_ACC_PROTECTED); diff --git a/ext/stub/properties/staticpropertyarray.zep.c b/ext/stub/properties/staticpropertyarray.zep.c index 3818923068..7fe81baa81 100644 --- a/ext/stub/properties/staticpropertyarray.zep.c +++ b/ext/stub/properties/staticpropertyarray.zep.c @@ -18,8 +18,8 @@ /** - * @link https://github.com/phalcon/zephir/issues/367 - * @link https://github.com/phalcon/zephir/issues/188 + * @link https://github.com/zephir-lang/zephir/issues/367 + * @link https://github.com/zephir-lang/zephir/issues/188 */ ZEPHIR_INIT_CLASS(Stub_Properties_StaticPropertyArray) { diff --git a/ext/stub/spropertyaccess.zep.c b/ext/stub/spropertyaccess.zep.c index 7eb5c9f00c..82677dda79 100644 --- a/ext/stub/spropertyaccess.zep.c +++ b/ext/stub/spropertyaccess.zep.c @@ -205,7 +205,7 @@ PHP_METHOD(Stub_SPropertyAccess, mutateStringVarInsideCycle) { } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @see https://github.com/zephir-lang/zephir/issues/1494 */ PHP_METHOD(Stub_SPropertyAccess, mutateIntVarInsideCycle) { @@ -245,7 +245,7 @@ PHP_METHOD(Stub_SPropertyAccess, mutateIntVarInsideCycle) { } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @see https://github.com/zephir-lang/zephir/issues/1494 */ PHP_METHOD(Stub_SPropertyAccess, mutateDoubleVarInsideCycle) { diff --git a/ext/stub/statements.zep.c b/ext/stub/statements.zep.c index 353c8b2157..2336044f2a 100644 --- a/ext/stub/statements.zep.c +++ b/ext/stub/statements.zep.c @@ -31,7 +31,7 @@ ZEPHIR_INIT_CLASS(Stub_Statements) { zend_declare_property_string(stub_statements_ce, SL("tmp2"), "test string", ZEND_ACC_PUBLIC); /** - * @issue https://github.com/phalcon/zephir/issues/544 + * @issue https://github.com/zephir-lang/zephir/issues/544 */ zend_declare_property_long(stub_statements_ce, SL("totalSteps"), 100, ZEND_ACC_PRIVATE); diff --git a/ext/stub/ternary.zep.c b/ext/stub/ternary.zep.c index 997bf60ed5..d2503a595a 100644 --- a/ext/stub/ternary.zep.c +++ b/ext/stub/ternary.zep.c @@ -210,7 +210,7 @@ PHP_METHOD(Stub_Ternary, testTernaryComplex3) { } /** - * @link https://github.com/phalcon/zephir/issues/665 + * @link https://github.com/zephir-lang/zephir/issues/665 */ PHP_METHOD(Stub_Ternary, testTernaryWithPromotedTemporaryVariable) { @@ -249,7 +249,7 @@ PHP_METHOD(Stub_Ternary, testTernaryWithPromotedTemporaryVariable) { } /** - * @link https://github.com/phalcon/zephir/issues/297 + * @link https://github.com/zephir-lang/zephir/issues/297 */ PHP_METHOD(Stub_Ternary, testTernaryAfterLetVariable) { diff --git a/ext/stub/vars.zep.c b/ext/stub/vars.zep.c index c40c3be492..3377be2048 100644 --- a/ext/stub/vars.zep.c +++ b/ext/stub/vars.zep.c @@ -451,7 +451,7 @@ PHP_METHOD(Stub_Vars, testArrayTypeVarDumpAndExport) { } /** - * @link https://github.com/phalcon/zephir/issues/681 + * @link https://github.com/zephir-lang/zephir/issues/681 */ PHP_METHOD(Stub_Vars, testIntVarDump) { diff --git a/stub/arraysearch.zep b/stub/arraysearch.zep index 2ba718d315..c3f4698cb8 100644 --- a/stub/arraysearch.zep +++ b/stub/arraysearch.zep @@ -2,13 +2,13 @@ namespace Stub; class ArraySearch { - /** @issue https://github.com/phalcon/zephir/issues/1609 */ + /** @issue https://github.com/zephir-lang/zephir/issues/1609 */ public function simpleSearch(var needle, array haystack, bool strict = false) -> var { return array_search(needle, haystack, strict); } - /** @issue https://github.com/phalcon/zephir/issues/1609 */ + /** @issue https://github.com/zephir-lang/zephir/issues/1609 */ public function searchUsingArrayInsideZephir() -> var { array itoA64 = [".", "/", "0", "1", "2", "3", "4", "value", "OtherValue"]; diff --git a/stub/assign.zep b/stub/assign.zep index 559f834aae..26d0e1eb8f 100644 --- a/stub/assign.zep +++ b/stub/assign.zep @@ -349,7 +349,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ public function testAssign41(int num) -> int { @@ -361,7 +361,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ public function testAssign42(int num) -> int { @@ -882,7 +882,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/159 + * @link https://github.com/zephir-lang/zephir/issues/159 */ public function testGlobalVarAssign(var index, var value) { @@ -890,7 +890,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/523 + * @link https://github.com/zephir-lang/zephir/issues/523 */ public function testConstantKeyAssign() { @@ -899,7 +899,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/746 + * @link https://github.com/zephir-lang/zephir/issues/746 * */ public function testArrayBoolExpressionAssign() @@ -912,7 +912,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/725 + * @link https://github.com/zephir-lang/zephir/issues/725 */ public function testAssignSuperGlobals() { @@ -925,7 +925,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/1917 + * @link https://github.com/zephir-lang/zephir/issues/1917 */ public function testAssignSuperGlobalsSERVER() { @@ -933,7 +933,7 @@ class Assign } /** - * @link https://github.com/phalcon/zephir/issues/1917 + * @link https://github.com/zephir-lang/zephir/issues/1917 */ public function testAssignSuperGlobalsGET() { diff --git a/stub/bitwise.zep b/stub/bitwise.zep index 9fc335847c..91cd4ed33a 100644 --- a/stub/bitwise.zep +++ b/stub/bitwise.zep @@ -954,7 +954,7 @@ class Bitwise } /** - * @issue https://github.com/phalcon/zephir/issues/1581 + * @issue https://github.com/zephir-lang/zephir/issues/1581 */ public function testbitwiseXor() { diff --git a/stub/cast.zep b/stub/cast.zep index 626cdea05f..a31e88ed4d 100644 --- a/stub/cast.zep +++ b/stub/cast.zep @@ -10,7 +10,7 @@ class Cast // To char cast /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testCharCastFromChar() -> char { @@ -18,7 +18,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testCharCastFromVariableChar() -> char { @@ -29,7 +29,7 @@ class Cast // To string cast /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testStringCastChar() -> string { @@ -37,7 +37,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testStringCastVariableChar() -> string { @@ -59,7 +59,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testIntCastFromChar() -> int { @@ -67,7 +67,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testIntCastFromVariableChar() -> int { @@ -171,7 +171,7 @@ class Cast // To long cast /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testLongCastFromChar() -> long { @@ -179,7 +179,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testLongCastFromVariableChar() -> long { @@ -278,7 +278,7 @@ class Cast // To double cast /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testDoubleCastFromVChar() -> double { @@ -286,7 +286,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testDoubleCastFromVariableChar() -> double { @@ -337,7 +337,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testBooleanCastFromChar() -> boolean { @@ -345,7 +345,7 @@ class Cast } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testBooleanCastFromVariableChar() -> boolean { diff --git a/stub/compare.zep b/stub/compare.zep index c927bc11b8..ad6082e24d 100644 --- a/stub/compare.zep +++ b/stub/compare.zep @@ -30,7 +30,7 @@ class Compare } /** - * @link https://github.com/phalcon/zephir/issues/411 + * @link https://github.com/zephir-lang/zephir/issues/411 */ public function testVarWithStringEquals(string! str) { diff --git a/stub/concat.zep b/stub/concat.zep index c8dbb38a3e..990930916a 100644 --- a/stub/concat.zep +++ b/stub/concat.zep @@ -34,7 +34,7 @@ class Concat } /** - * @link https://github.com/phalcon/zephir/issues/1573 + * @link https://github.com/zephir-lang/zephir/issues/1573 */ public function testConcat3() -> string { @@ -46,7 +46,7 @@ class Concat } /** - * @link https://github.com/phalcon/zephir/issues/1893 + * @link https://github.com/zephir-lang/zephir/issues/1893 */ public function testConcat4(var value) -> string { @@ -63,7 +63,7 @@ class Concat } /** - * @link https://github.com/phalcon/zephir/issues/1893 + * @link https://github.com/zephir-lang/zephir/issues/1893 */ public function testConcat5(double number) -> string { diff --git a/stub/constants.zep b/stub/constants.zep index 17621670b7..93c2bfac2a 100644 --- a/stub/constants.zep +++ b/stub/constants.zep @@ -115,7 +115,7 @@ class Constants extends ConstantsParent /** * Test Delimiters as String Constants * - * @link https://github.com/phalcon/zephir/issues/1571 + * @link https://github.com/zephir-lang/zephir/issues/1571 */ public function testStringDelimiterConstantDoubleQuoted() { diff --git a/stub/exception.zep b/stub/exception.zep index 09caa00d7d..fa328fc7cd 100644 --- a/stub/exception.zep +++ b/stub/exception.zep @@ -7,7 +7,7 @@ namespace Stub; class Exception extends \Exception { /** - * @link https://github.com/phalcon/zephir/issues/915 + * @link https://github.com/zephir-lang/zephir/issues/915 */ public function testRuntimePropertyFetch(string! message) { diff --git a/stub/functions.zep b/stub/functions.zep index 38d57e1de7..9bc4104f15 100644 --- a/stub/functions.zep +++ b/stub/functions.zep @@ -4,7 +4,7 @@ namespace Stub; class Functions { /** - * @issue https://github.com/phalcon/zephir/issues/658 + * @issue https://github.com/zephir-lang/zephir/issues/658 */ public function filterVar1() -> bool { @@ -15,7 +15,7 @@ class Functions } /** - * @issue https://github.com/phalcon/zephir/issues/658 + * @issue https://github.com/zephir-lang/zephir/issues/658 */ public function filterVar2() -> bool { diff --git a/stub/globals/post.zep b/stub/globals/post.zep index 77e097c84c..b7bed04f9c 100644 --- a/stub/globals/post.zep +++ b/stub/globals/post.zep @@ -6,7 +6,7 @@ class Post /** * Tests "Invalid superglobal for _POST" * - * @issue https://github.com/phalcon/zephir/issues/1623 + * @issue https://github.com/zephir-lang/zephir/issues/1623 */ public function hasValue(string name) -> boolean { diff --git a/stub/globals/server.zep b/stub/globals/server.zep index 10aeb0ed61..f0f8b4c04c 100644 --- a/stub/globals/server.zep +++ b/stub/globals/server.zep @@ -3,7 +3,7 @@ namespace Stub\Globals; class Server { /** - * @see https://github.com/phalcon/zephir/issues/1961 + * @see https://github.com/zephir-lang/zephir/issues/1961 */ public function f1() -> void { @@ -18,7 +18,7 @@ class Server } /** - * @see https://github.com/phalcon/zephir/issues/1970 + * @see https://github.com/zephir-lang/zephir/issues/1970 */ public function check() -> var { diff --git a/stub/globals/serverrequestfactory.zep b/stub/globals/serverrequestfactory.zep index b6e9786ad9..cc4b3a0b18 100644 --- a/stub/globals/serverrequestfactory.zep +++ b/stub/globals/serverrequestfactory.zep @@ -3,7 +3,7 @@ namespace Stub\Globals; class ServerRequestFactory { /** - * @link https://github.com/phalcon/zephir/issues/1934 + * @link https://github.com/zephir-lang/zephir/issues/1934 */ public function load( array server = null, diff --git a/stub/mcall.zep b/stub/mcall.zep index 1c018efcaf..30491e46ff 100644 --- a/stub/mcall.zep +++ b/stub/mcall.zep @@ -206,7 +206,7 @@ class Mcall } /** - * @link https://github.com/phalcon/zephir/issues/142 + * @link https://github.com/zephir-lang/zephir/issues/142 */ public function testArrayParamWithDefaultEmptyArray(array driverOptions = []) { diff --git a/stub/mcalldynamic.zep b/stub/mcalldynamic.zep index 66f2bce1ef..ea52ba0c35 100644 --- a/stub/mcalldynamic.zep +++ b/stub/mcalldynamic.zep @@ -28,7 +28,7 @@ class McallDynamic } /** - * @link https://github.com/phalcon/zephir/issues/1751 + * @link https://github.com/zephir-lang/zephir/issues/1751 */ public function testCallAnonymousFunctionWithContext() -> var { diff --git a/stub/methodargs.zep b/stub/methodargs.zep index e310a3d0c6..cf4be53904 100644 --- a/stub/methodargs.zep +++ b/stub/methodargs.zep @@ -38,7 +38,7 @@ class MethodArgs } /** - * @link https://github.com/phalcon/zephir/issues/336 + * @link https://github.com/zephir-lang/zephir/issues/336 */ public function methodOptionalValueWithDefaultStaticConstantAccess(var method = self::GET) { @@ -47,7 +47,7 @@ class MethodArgs /** * For string parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ public function methodOptionalStringValueWithDefaultStaticConstantAccess(string parameter = self::GET) { @@ -56,7 +56,7 @@ class MethodArgs /** * For double parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ public function methodOptionalDoubleValueWithDefaultStaticConstantAccess(double parameter = self::MY_DOUBLE) { @@ -65,7 +65,7 @@ class MethodArgs /** * For bool parameter - * @link https://github.com/phalcon/zephir/issues/696 + * @link https://github.com/zephir-lang/zephir/issues/696 */ public function methodOptionalBoolValueWithDefaultStaticConstantAccess(bool parameter = self::MY_BOOL) { @@ -74,7 +74,7 @@ class MethodArgs /** * For int parameter - * @link https://github.com/phalcon/zephir/issues/728 + * @link https://github.com/zephir-lang/zephir/issues/728 */ public function methodOptionalIntValueWithDefaultStaticConstantAccess(int parameter = self::MY_INT) { diff --git a/stub/nativearray.zep b/stub/nativearray.zep index 2607391b52..d955b79816 100644 --- a/stub/nativearray.zep +++ b/stub/nativearray.zep @@ -579,7 +579,7 @@ class NativeArray } /** - * @link https://github.com/phalcon/zephir/issues/110 + * @link https://github.com/zephir-lang/zephir/issues/110 */ public function issue110()-> string { @@ -614,7 +614,7 @@ class NativeArray } /** - * @link https://github.com/phalcon/zephir/issues/709 + * @link https://github.com/zephir-lang/zephir/issues/709 */ public function issue709() -> bool { diff --git a/stub/oo/propertyaccess.zep b/stub/oo/propertyaccess.zep index 3aa0c4ad56..6197a0e38b 100644 --- a/stub/oo/propertyaccess.zep +++ b/stub/oo/propertyaccess.zep @@ -25,7 +25,7 @@ class PropertyAccess } /** - * @issue https://github.com/phalcon/zephir/issues/1851 + * @issue https://github.com/zephir-lang/zephir/issues/1851 */ public function setPrivatevariable(value) -> { @@ -35,7 +35,7 @@ class PropertyAccess } /** - * @issue https://github.com/phalcon/zephir/issues/1851 + * @issue https://github.com/zephir-lang/zephir/issues/1851 */ public function getPrivatevariable() -> var { diff --git a/stub/oo/scopes/privatescopetester.zep b/stub/oo/scopes/privatescopetester.zep index df152764f4..3bf5466cf0 100644 --- a/stub/oo/scopes/privatescopetester.zep +++ b/stub/oo/scopes/privatescopetester.zep @@ -8,7 +8,7 @@ class PrivateScopeTester extends HasPrivateMethod implements ScopeTesterInterfac } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ public function setPropertyObj(var obj, string property, var value) -> var { @@ -18,7 +18,7 @@ class PrivateScopeTester extends HasPrivateMethod implements ScopeTesterInterfac } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ public function setPropertyNew(string className, string property, var value) -> var { @@ -31,7 +31,7 @@ class PrivateScopeTester extends HasPrivateMethod implements ScopeTesterInterfac } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ public function getObjVars(var obj) -> var { @@ -39,7 +39,7 @@ class PrivateScopeTester extends HasPrivateMethod implements ScopeTesterInterfac } /** - * @issue https://github.com/phalcon/zephir/issues/2057 + * @issue https://github.com/zephir-lang/zephir/issues/2057 */ public function getNewVars(string className) -> var { diff --git a/stub/optimizers/strreplace.zep b/stub/optimizers/strreplace.zep index ff5aaa9df5..a8ecd4f59e 100644 --- a/stub/optimizers/strreplace.zep +++ b/stub/optimizers/strreplace.zep @@ -4,7 +4,7 @@ namespace Stub\Optimizers; class StrReplace { /** - * @link https://github.com/phalcon/zephir/issues/1055 + * @link https://github.com/zephir-lang/zephir/issues/1055 */ static public function issue1055() { diff --git a/stub/pregmatch.zep b/stub/pregmatch.zep index 363a35768d..fbd6c672d2 100644 --- a/stub/pregmatch.zep +++ b/stub/pregmatch.zep @@ -88,7 +88,7 @@ class Pregmatch } /** - * @link https://github.com/phalcon/zephir/issues/287 + * @link https://github.com/zephir-lang/zephir/issues/287 */ public function testPregMatchSaveMatches(string str, string pattern) { diff --git a/stub/properties/propertyarray.zep b/stub/properties/propertyarray.zep index dff14198f8..887057bdf2 100644 --- a/stub/properties/propertyarray.zep +++ b/stub/properties/propertyarray.zep @@ -2,7 +2,7 @@ namespace Stub\Properties; /** - * @link https://github.com/phalcon/zephir/issues/520 + * @link https://github.com/zephir-lang/zephir/issues/520 */ class PropertyArray { diff --git a/stub/properties/publicproperties.zep b/stub/properties/publicproperties.zep index 992d8c1fe4..9bee7eb07f 100644 --- a/stub/properties/publicproperties.zep +++ b/stub/properties/publicproperties.zep @@ -52,13 +52,13 @@ class PublicProperties /** * It's needed to test ide stubs - * @link https://github.com/phalcon/zephir/issues/731 + * @link https://github.com/zephir-lang/zephir/issues/731 */ protected someArrayWithSpecifyKeys = ["a": "A", "b": "B", "c": "C"]; /** * It's needed to test ide stubs - * @link https://github.com/phalcon/zephir/issues/731 + * @link https://github.com/zephir-lang/zephir/issues/731 */ protected someArrayWithSubArray = [ "success": ["class": "alert alert-success"], diff --git a/stub/properties/staticpropertyarray.zep b/stub/properties/staticpropertyarray.zep index 0adeb591ac..0c1517adca 100644 --- a/stub/properties/staticpropertyarray.zep +++ b/stub/properties/staticpropertyarray.zep @@ -2,8 +2,8 @@ namespace Stub\Properties; /** - * @link https://github.com/phalcon/zephir/issues/367 - * @link https://github.com/phalcon/zephir/issues/188 + * @link https://github.com/zephir-lang/zephir/issues/367 + * @link https://github.com/zephir-lang/zephir/issues/188 */ class StaticPropertyArray { diff --git a/stub/spropertyaccess.zep b/stub/spropertyaccess.zep index cef94f8500..e6660bb1ed 100644 --- a/stub/spropertyaccess.zep +++ b/stub/spropertyaccess.zep @@ -54,7 +54,7 @@ class SPropertyAccess } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @see https://github.com/zephir-lang/zephir/issues/1494 */ public static function mutateIntVarInsideCycle() -> int { @@ -69,7 +69,7 @@ class SPropertyAccess } /** - * @see https://github.com/phalcon/zephir/issues/1494 + * @see https://github.com/zephir-lang/zephir/issues/1494 */ public static function mutateDoubleVarInsideCycle() -> double { diff --git a/stub/statements.zep b/stub/statements.zep index 9dd5aaf791..aba67588e4 100644 --- a/stub/statements.zep +++ b/stub/statements.zep @@ -6,7 +6,7 @@ class Statements public tmp2 = "test string"; /** - * @issue https://github.com/phalcon/zephir/issues/544 + * @issue https://github.com/zephir-lang/zephir/issues/544 */ private totalSteps = 100; diff --git a/stub/ternary.zep b/stub/ternary.zep index 409ec22111..809724db0a 100644 --- a/stub/ternary.zep +++ b/stub/ternary.zep @@ -33,7 +33,7 @@ class Ternary } /** - * @link https://github.com/phalcon/zephir/issues/665 + * @link https://github.com/zephir-lang/zephir/issues/665 */ public function testTernaryWithPromotedTemporaryVariable() { @@ -47,7 +47,7 @@ class Ternary } /** - * @link https://github.com/phalcon/zephir/issues/297 + * @link https://github.com/zephir-lang/zephir/issues/297 */ public function testTernaryAfterLetVariable() { diff --git a/stub/vars.zep b/stub/vars.zep index 7af71ff6d1..9299bb732f 100644 --- a/stub/vars.zep +++ b/stub/vars.zep @@ -80,7 +80,7 @@ class Vars } /** - * @link https://github.com/phalcon/zephir/issues/681 + * @link https://github.com/zephir-lang/zephir/issues/681 */ public function testIntVarDump() { diff --git a/tests/Extension/ArraySearchTest.php b/tests/Extension/ArraySearchTest.php index 44139148f0..3db6ce70cb 100644 --- a/tests/Extension/ArraySearchTest.php +++ b/tests/Extension/ArraySearchTest.php @@ -26,7 +26,7 @@ protected function setUp(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1609 + * @issue https://github.com/zephir-lang/zephir/issues/1609 */ public function testShouldSearchInTheExternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey(): void { @@ -37,7 +37,7 @@ public function testShouldSearchInTheExternalArrayForAGivenValueAndReturnTheFirs } /** - * @issue https://github.com/phalcon/zephir/issues/1609 + * @issue https://github.com/zephir-lang/zephir/issues/1609 */ public function testShouldSearchInTheInternalArrayForAGivenValueAndReturnTheFirstCorrespondingKey(): void { diff --git a/tests/Extension/BitwiseTest.php b/tests/Extension/BitwiseTest.php index d9e553a1c0..99f469239f 100644 --- a/tests/Extension/BitwiseTest.php +++ b/tests/Extension/BitwiseTest.php @@ -128,7 +128,7 @@ public function testBitwise() /** * Bitwise XOR - * @issue https://github.com/phalcon/zephir/issues/1581 + * @issue https://github.com/zephir-lang/zephir/issues/1581 */ $this->assertSame(123 ^ 321, $test->testbitwiseXor()); } diff --git a/tests/Extension/CastTest.php b/tests/Extension/CastTest.php index b7e97f0724..d92482886c 100644 --- a/tests/Extension/CastTest.php +++ b/tests/Extension/CastTest.php @@ -31,7 +31,7 @@ protected function tearDown(): void } /** - * @see https://github.com/phalcon/zephir/issues/1988 + * @see https://github.com/zephir-lang/zephir/issues/1988 */ public function testCharCast(): void { @@ -47,7 +47,7 @@ public function testCharCast(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ public function testStringCast(): void { @@ -86,7 +86,7 @@ public function testIntCast(): void $this->assertSame(0, $this->test->testIntCastFromVariableNull()); /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ $this->assertSame(97, $this->test->testIntCastFromVariableChar()); @@ -103,7 +103,7 @@ public function testIntCast(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ public function testLongCast(): void { @@ -138,7 +138,7 @@ public function testFloatCast(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ public function testDoubleCast(): void { @@ -163,7 +163,7 @@ public function testBooleanCast(): void $this->assertFalse($this->test->testBooleanCastFromIntFalse()); /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ $this->assertTrue($this->test->testBooleanCastFromChar()); @@ -176,7 +176,7 @@ public function testBooleanCast(): void $this->assertFalse($this->test->testBooleanCastFromNull()); /** - * @issue https://github.com/phalcon/zephir/issues/1988 + * @issue https://github.com/zephir-lang/zephir/issues/1988 */ $this->assertTrue($this->test->testBooleanCastFromVariableChar()); } diff --git a/tests/Extension/ConcatTest.php b/tests/Extension/ConcatTest.php index ebd69a8350..4653a09c08 100644 --- a/tests/Extension/ConcatTest.php +++ b/tests/Extension/ConcatTest.php @@ -47,7 +47,7 @@ public function testShouldConcatenateVariableWithString(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1573 + * @issue https://github.com/zephir-lang/zephir/issues/1573 */ public function testShouldConcatenateStringsSimilarToIntegersNumbers(): void { @@ -55,7 +55,7 @@ public function testShouldConcatenateStringsSimilarToIntegersNumbers(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1893 + * @issue https://github.com/zephir-lang/zephir/issues/1893 */ public function testShouldConcatenateStringWithVarDouble(): void { @@ -66,7 +66,7 @@ public function testShouldConcatenateStringWithVarDouble(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1893 + * @issue https://github.com/zephir-lang/zephir/issues/1893 */ public function testShouldConcatenateStringWithDouble(): void { diff --git a/tests/Extension/ConstantsTest.php b/tests/Extension/ConstantsTest.php index f460b60993..b4560a6e53 100644 --- a/tests/Extension/ConstantsTest.php +++ b/tests/Extension/ConstantsTest.php @@ -92,7 +92,7 @@ public function testMagickConstants(): void * @author Alexnder Andriiako * * @since 2017-08-09 - * @issue https://github.com/phalcon/zephir/issues/1571 + * @issue https://github.com/zephir-lang/zephir/issues/1571 */ public function testStringDelimiterAsConstDoubleQuoted(): void { diff --git a/tests/Extension/FunctionExistsTest.php b/tests/Extension/FunctionExistsTest.php index c9f20a2fd5..48c45b6df1 100644 --- a/tests/Extension/FunctionExistsTest.php +++ b/tests/Extension/FunctionExistsTest.php @@ -27,7 +27,7 @@ protected function setUp(): void /** * @dataProvider providerInternalFunctions - * @issue https://github.com/phalcon/zephir/issues/1547 + * @issue https://github.com/zephir-lang/zephir/issues/1547 * * @param string $func The internal (built-in) function name */ @@ -37,7 +37,7 @@ public function testShouldCorrectDetectestExistenceWithPassedName(string $func): } /** - * @issue https://github.com/phalcon/zephir/issues/1547 + * @issue https://github.com/zephir-lang/zephir/issues/1547 */ public function testShouldCorrectDetectestExistenceInsideTheZephirCode(): void { @@ -56,7 +56,7 @@ public function testShouldCorrectDetectestExistenceInsideTheZephirCode(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1547 + * @issue https://github.com/zephir-lang/zephir/issues/1547 */ public function testShouldCorrectDetectestExistenceByUsingString(): void { diff --git a/tests/Extension/Globals/PostTest.php b/tests/Extension/Globals/PostTest.php index ef2b72113f..21f8a8af68 100644 --- a/tests/Extension/Globals/PostTest.php +++ b/tests/Extension/Globals/PostTest.php @@ -19,7 +19,7 @@ final class PostTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1623 + * @issue https://github.com/zephir-lang/zephir/issues/1623 */ public function testShouldNotTriggerAnyErrorIfPostIsUndefined(): void { @@ -32,7 +32,7 @@ public function testShouldNotTriggerAnyErrorIfPostIsUndefined(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1623 + * @issue https://github.com/zephir-lang/zephir/issues/1623 */ public function testShouldReturnFalseIfVariableIsUndefined(): void { @@ -45,7 +45,7 @@ public function testShouldReturnFalseIfVariableIsUndefined(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1623 + * @issue https://github.com/zephir-lang/zephir/issues/1623 */ public function testShouldReturnTrueIfVariableIsDefined(): void { diff --git a/tests/Extension/Globals/ServerRequestFactoryTest.php b/tests/Extension/Globals/ServerRequestFactoryTest.php index fe1219bbf5..84efef0de0 100644 --- a/tests/Extension/Globals/ServerRequestFactoryTest.php +++ b/tests/Extension/Globals/ServerRequestFactoryTest.php @@ -37,7 +37,7 @@ protected function tearDown(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1934 + * @issue https://github.com/zephir-lang/zephir/issues/1934 */ public function testShouldNotTriggerAnyErrorIfPostIsUndefined(): void { diff --git a/tests/Extension/Globals/ServerTest.php b/tests/Extension/Globals/ServerTest.php index 718df93f6e..40aa574403 100644 --- a/tests/Extension/Globals/ServerTest.php +++ b/tests/Extension/Globals/ServerTest.php @@ -31,7 +31,7 @@ protected function tearDown(): void } /** - * @see https://github.com/phalcon/zephir/issues/1961 + * @see https://github.com/zephir-lang/zephir/issues/1961 */ public function testShouldPrintPhpSelf(): void { @@ -46,7 +46,7 @@ public function testShouldPrintPhpSelf(): void } /** - * @see https://github.com/phalcon/zephir/issues/1961 + * @see https://github.com/zephir-lang/zephir/issues/1961 */ public function testShouldPrintUserAgent(): void { diff --git a/tests/Extension/InstanceOffTest.php b/tests/Extension/InstanceOffTest.php index 16a3f9defd..ff3cc51904 100644 --- a/tests/Extension/InstanceOffTest.php +++ b/tests/Extension/InstanceOffTest.php @@ -55,8 +55,8 @@ public function testInstanceOf4(): void } /** - * @issue https://github.com/phalcon/zephir/issues/776 - * @issue https://github.com/phalcon/zephir/issues/822 + * @issue https://github.com/zephir-lang/zephir/issues/776 + * @issue https://github.com/zephir-lang/zephir/issues/822 */ public function testInstanceOf5(): void { @@ -70,7 +70,7 @@ public function testInstanceOf6(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/zephir-lang/zephir/issues/1828 */ public function testInstanceOf7(): void { @@ -79,7 +79,7 @@ public function testInstanceOf7(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/zephir-lang/zephir/issues/1828 */ public function testInstanceOf8(): void { @@ -88,7 +88,7 @@ public function testInstanceOf8(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1828 + * @issue https://github.com/zephir-lang/zephir/issues/1828 */ public function testInstanceOf9(): void { diff --git a/tests/Extension/InstanceTest.php b/tests/Extension/InstanceTest.php index d35a999d0e..268b67d533 100644 --- a/tests/Extension/InstanceTest.php +++ b/tests/Extension/InstanceTest.php @@ -19,7 +19,7 @@ final class InstanceTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1339 + * @issue https://github.com/zephir-lang/zephir/issues/1339 */ public function testShouldCreateAnInstanceUsingMoreThan10Parameters(): void { diff --git a/tests/Extension/MCallDynamicTest.php b/tests/Extension/MCallDynamicTest.php index 528e23124e..8175e0349d 100644 --- a/tests/Extension/MCallDynamicTest.php +++ b/tests/Extension/MCallDynamicTest.php @@ -26,7 +26,7 @@ public function testCallDynamic(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1751 + * @issue https://github.com/zephir-lang/zephir/issues/1751 */ public function testCallAnonymousFunctionWithContext(): void { diff --git a/tests/Extension/McallInternalTest.php b/tests/Extension/McallInternalTest.php index 6f396a4025..4fab1b35e1 100644 --- a/tests/Extension/McallInternalTest.php +++ b/tests/Extension/McallInternalTest.php @@ -19,7 +19,7 @@ final class McallInternalTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1956 + * @issue https://github.com/zephir-lang/zephir/issues/1956 */ public function testShouldReturnInstance(): void { diff --git a/tests/Extension/Oo/ExtendClassTest.php b/tests/Extension/Oo/ExtendClassTest.php index b1d130db5d..56a758d070 100644 --- a/tests/Extension/Oo/ExtendClassTest.php +++ b/tests/Extension/Oo/ExtendClassTest.php @@ -40,7 +40,7 @@ public function testPDOStatementExtending(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1686 + * @issue https://github.com/zephir-lang/zephir/issues/1686 */ public function testShouldExtendMiddlewareInterface(): void { @@ -54,7 +54,7 @@ public function testShouldExtendMiddlewareInterface(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1392 + * @issue https://github.com/zephir-lang/zephir/issues/1392 */ public function testShouldCorrectWorkWithLateStaticBinding(): void { @@ -62,7 +62,7 @@ public function testShouldCorrectWorkWithLateStaticBinding(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1372 + * @issue https://github.com/zephir-lang/zephir/issues/1372 */ public function testShouldCallParentMethodFromStaticByUsingSelf(): void { diff --git a/tests/Extension/Oo/Scopes/PrivateScopeTest.php b/tests/Extension/Oo/Scopes/PrivateScopeTest.php index 7926199d4b..4c593fb5ad 100644 --- a/tests/Extension/Oo/Scopes/PrivateScopeTest.php +++ b/tests/Extension/Oo/Scopes/PrivateScopeTest.php @@ -32,7 +32,7 @@ public function testShouldCallPrivateMethod(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyObjPhp(): void { @@ -46,7 +46,7 @@ public function testShouldNotSetPrivatePropertyObjPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyNewPhp(): void { @@ -60,7 +60,7 @@ public function testShouldNotSetPrivatePropertyNewPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyObjInternal(): void { @@ -74,7 +74,7 @@ public function testShouldNotSetPrivatePropertyObjInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyNewInternal(): void { @@ -88,7 +88,7 @@ public function testShouldNotSetPrivatePropertyNewInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldSetPrivatePropertyObjPhp(): void { @@ -101,7 +101,7 @@ public function testShouldSetPrivatePropertyObjPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldSetPrivatePropertyNewPhp(): void { @@ -113,7 +113,7 @@ public function testShouldSetPrivatePropertyNewPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldSetPrivatePropertyObjInternal(): void { @@ -126,7 +126,7 @@ public function testShouldSetPrivatePropertyObjInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldSetPrivatePropertyNewInternal(): void { @@ -138,7 +138,7 @@ public function testShouldSetPrivatePropertyNewInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyViaThis(): void { @@ -152,7 +152,7 @@ public function testShouldNotSetPrivatePropertyViaThis(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldSetPrivatePropertyViaThis(): void { @@ -163,7 +163,7 @@ public function testShouldSetPrivatePropertyViaThis(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyExtendedMagicObjInternal(): void { @@ -180,7 +180,7 @@ public function testShouldNotSetPrivatePropertyExtendedMagicObjInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyExtendedMagicNewInternal(): void { @@ -198,7 +198,7 @@ public function testShouldNotSetPrivatePropertyExtendedMagicNewInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyExtendedMagicObjPhp(): void { @@ -221,7 +221,7 @@ public function testShouldNotSetPrivatePropertyExtendedMagicObjPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotSetPrivatePropertyExtendedMagicNewPhp(): void { @@ -239,7 +239,7 @@ public function testShouldNotSetPrivatePropertyExtendedMagicNewPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotGetObjectVarsPrivatePropertyObjPhp(): void { @@ -251,7 +251,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyObjPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotGetObjectVarsPrivatePropertyNewPhp(): void { @@ -262,7 +262,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyNewPhp(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotGetObjectVarsPrivatePropertyObjInternal(): void { @@ -274,7 +274,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyObjInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/2057 + * @see https://github.com/zephir-lang/zephir/issues/2057 */ public function testShouldNotGetObjectVarsPrivatePropertyNewInternal(): void { @@ -285,7 +285,7 @@ public function testShouldNotGetObjectVarsPrivatePropertyNewInternal(): void } /** - * @see https://github.com/phalcon/zephir/issues/1851 + * @see https://github.com/zephir-lang/zephir/issues/1851 */ public function testShouldGetAndSetPrivatePropertyUsingParentGetterAndSetter(): void { diff --git a/tests/Extension/OoTest.php b/tests/Extension/OoTest.php index 8e7934b604..18b2006bbb 100644 --- a/tests/Extension/OoTest.php +++ b/tests/Extension/OoTest.php @@ -74,7 +74,7 @@ public function testAssertations(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1673 + * @issue https://github.com/zephir-lang/zephir/issues/1673 */ public function testShouldDinamicalyCreateInstancesInLoop(): void { diff --git a/tests/Extension/Optimizers/IsPhpVersionTest.php b/tests/Extension/Optimizers/IsPhpVersionTest.php index 435bf6b889..72467c7cef 100644 --- a/tests/Extension/Optimizers/IsPhpVersionTest.php +++ b/tests/Extension/Optimizers/IsPhpVersionTest.php @@ -19,7 +19,7 @@ /** * Extension\Optimizers\IsPhpVersionTest. * - * @issue https://github.com/phalcon/zephir/issues/1404 + * @issue https://github.com/zephir-lang/zephir/issues/1404 */ final class IsPhpVersionTest extends TestCase { diff --git a/tests/Extension/PregmatchTest.php b/tests/Extension/PregmatchTest.php index 58676fc8e9..7d2539d258 100644 --- a/tests/Extension/PregmatchTest.php +++ b/tests/Extension/PregmatchTest.php @@ -36,7 +36,7 @@ public function testPregMatch(): void } /** - * @issue https://github.com/phalcon/zephir/issues/287 + * @issue https://github.com/zephir-lang/zephir/issues/287 */ public function testCollectMatches(): void { @@ -44,7 +44,7 @@ public function testCollectMatches(): void } /** - * @issue https://github.com/phalcon/zephir/issues/144 + * @issue https://github.com/zephir-lang/zephir/issues/144 */ public function testPregMatchAllFlags(): void { diff --git a/tests/Extension/Properties/ProtectedPropertiesTest.php b/tests/Extension/Properties/ProtectedPropertiesTest.php index 98e1c1ddfa..63d3cc4a34 100644 --- a/tests/Extension/Properties/ProtectedPropertiesTest.php +++ b/tests/Extension/Properties/ProtectedPropertiesTest.php @@ -45,7 +45,7 @@ public function testShouldSetAndGetProtectedPropertyUsingShortcuts(): void } /** - * @issue https://github.com/phalcon/zephir/issues/2089 + * @issue https://github.com/zephir-lang/zephir/issues/2089 */ public function testShouldSetAndGetProtectedPropertyUsingExtendedClass(): void { diff --git a/tests/Extension/Properties/PublicPropertiesTest.php b/tests/Extension/Properties/PublicPropertiesTest.php index 0e8261a488..4f83271589 100644 --- a/tests/Extension/Properties/PublicPropertiesTest.php +++ b/tests/Extension/Properties/PublicPropertiesTest.php @@ -42,7 +42,7 @@ public function test394Issue(): void } /** - * @issue https://github.com/phalcon/zephir/issues/537 + * @issue https://github.com/zephir-lang/zephir/issues/537 */ public function test537Issue(): void { diff --git a/tests/Extension/Properties/StaticPrivatePropertiesTest.php b/tests/Extension/Properties/StaticPrivatePropertiesTest.php index 56c10861fb..0429d6287c 100644 --- a/tests/Extension/Properties/StaticPrivatePropertiesTest.php +++ b/tests/Extension/Properties/StaticPrivatePropertiesTest.php @@ -20,7 +20,7 @@ final class StaticPrivatePropertiesTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1530 + * @issue https://github.com/zephir-lang/zephir/issues/1530 */ public function testShouldGetInstanceByUsingSingleton(): void { diff --git a/tests/Extension/Properties/StaticPublicPropertiesTest.php b/tests/Extension/Properties/StaticPublicPropertiesTest.php index 30413390ec..352890bae8 100644 --- a/tests/Extension/Properties/StaticPublicPropertiesTest.php +++ b/tests/Extension/Properties/StaticPublicPropertiesTest.php @@ -37,7 +37,7 @@ public function testIssues1904(): void StaticPublicProperties::$someString = 'test2'; $this->assertSame(StaticPublicProperties::$someString, $value); // Disabled due to: - // https://github.com/phalcon/zephir/issues/1941#issuecomment-538654340 + // https://github.com/zephir-lang/zephir/issues/1941#issuecomment-538654340 StaticPublicProperties::setSomeString('test3'); $this->assertSame(StaticPublicProperties::$someString, $value); } diff --git a/tests/Extension/RequiresTest.php b/tests/Extension/RequiresTest.php index 8a7d23f605..e6d85e0452 100644 --- a/tests/Extension/RequiresTest.php +++ b/tests/Extension/RequiresTest.php @@ -38,7 +38,7 @@ public function testRequireExternal1(): void } /** - * @issue https://github.com/phalcon/zephir/pull/1428 + * @issue https://github.com/zephir-lang/zephir/pull/1428 */ public function testShouldRequireUsingNewSymbolTable(): void { @@ -50,7 +50,7 @@ public function testShouldRequireUsingNewSymbolTable(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1621 + * @issue https://github.com/zephir-lang/zephir/issues/1621 */ public function testShouldRenderTemplate(): void { @@ -65,7 +65,7 @@ public function testShouldRenderTemplate(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1713 + * @issue https://github.com/zephir-lang/zephir/issues/1713 */ public function testShouldRequirePhar(): void { diff --git a/tests/Extension/ReturnsTest.php b/tests/Extension/ReturnsTest.php index 087e4f6925..43c052d98d 100644 --- a/tests/Extension/ReturnsTest.php +++ b/tests/Extension/ReturnsTest.php @@ -19,7 +19,7 @@ final class ReturnsTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1534 + * @issue https://github.com/zephir-lang/zephir/issues/1534 */ public function testShouldReturnWithParameter(): void { @@ -28,7 +28,7 @@ public function testShouldReturnWithParameter(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1534 + * @issue https://github.com/zephir-lang/zephir/issues/1534 */ public function testShouldReturnWithParameterStaticVersion(): void { @@ -36,7 +36,7 @@ public function testShouldReturnWithParameterStaticVersion(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1534 + * @issue https://github.com/zephir-lang/zephir/issues/1534 */ public function testShouldReturnWithoutParameter(): void { @@ -45,7 +45,7 @@ public function testShouldReturnWithoutParameter(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1534 + * @issue https://github.com/zephir-lang/zephir/issues/1534 */ public function testShouldReturnWithoutParameterStaticVersion(): void { diff --git a/tests/Extension/SPropertyAccessTest.php b/tests/Extension/SPropertyAccessTest.php index 929a1fafe9..3de6a066b2 100644 --- a/tests/Extension/SPropertyAccessTest.php +++ b/tests/Extension/SPropertyAccessTest.php @@ -41,7 +41,7 @@ public function testShouldMutateStringVarInsideCycle(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1494 + * @issue https://github.com/zephir-lang/zephir/issues/1494 */ public function testShouldMutateIntVarInsideCycle(): void { @@ -52,7 +52,7 @@ public function testShouldMutateIntVarInsideCycle(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1494 + * @issue https://github.com/zephir-lang/zephir/issues/1494 */ public function testShouldMutateDoubleVarInsideCycle(): void { diff --git a/tests/Extension/ScallLateConstructTest.php b/tests/Extension/ScallLateConstructTest.php index 715fe3ffdf..eeba905d5d 100644 --- a/tests/Extension/ScallLateConstructTest.php +++ b/tests/Extension/ScallLateConstructTest.php @@ -19,7 +19,7 @@ final class ScallLateConstructTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/2111 + * @issue https://github.com/zephir-lang/zephir/issues/2111 */ public function testConstruct(): void { diff --git a/tests/Extension/ScallTest.php b/tests/Extension/ScallTest.php index e3cad0a528..b4f35f0f98 100644 --- a/tests/Extension/ScallTest.php +++ b/tests/Extension/ScallTest.php @@ -51,7 +51,7 @@ public function testScall(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1622 + * @issue https://github.com/zephir-lang/zephir/issues/1622 */ public function testShouldReturnInterpolatedMethodFromZephir(): void { @@ -60,7 +60,7 @@ public function testShouldReturnInterpolatedMethodFromZephir(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1622 + * @issue https://github.com/zephir-lang/zephir/issues/1622 */ public function testShouldEchoInterpolatedMethodFromZephir(): void { diff --git a/tests/Extension/TypeHinting/AbstractTest.php b/tests/Extension/TypeHinting/AbstractTest.php index 24e8f8fc66..aa782f1f10 100644 --- a/tests/Extension/TypeHinting/AbstractTest.php +++ b/tests/Extension/TypeHinting/AbstractTest.php @@ -19,7 +19,7 @@ final class AbstractTest extends TestCase { /** - * @issue https://github.com/phalcon/zephir/issues/1667 + * @issue https://github.com/zephir-lang/zephir/issues/1667 */ public function testShouldCreateCompatibleChildClassUsingTypeHintedParams(): void { @@ -37,7 +37,7 @@ public function testShouldCreateCompatibleChildClassUsingTypeHintedParams(): voi } /** - * @issue https://github.com/phalcon/zephir/issues/1667 + * @issue https://github.com/zephir-lang/zephir/issues/1667 */ public function testShouldCreateCompatibleChildClassWithMultipleReturnTypesHint(): void { @@ -46,7 +46,7 @@ public function testShouldCreateCompatibleChildClassWithMultipleReturnTypesHint( } /** - * @issue https://github.com/phalcon/zephir/issues/1667 + * @issue https://github.com/zephir-lang/zephir/issues/1667 */ public function testShouldCreateCompatibleChildClassWithScalarType(): void { diff --git a/tests/Zephir/Documentation/Annotation/LinkTest.php b/tests/Zephir/Documentation/Annotation/LinkTest.php index 8b25051d39..4af46267bc 100644 --- a/tests/Zephir/Documentation/Annotation/LinkTest.php +++ b/tests/Zephir/Documentation/Annotation/LinkTest.php @@ -37,18 +37,18 @@ public function testShouldGetLink(): void public function testShouldGetUri(): void { - $testString = 'https://github.com/phalcon/zephir Zephir SRC'; + $testString = 'https://github.com/zephir-lang/zephir Zephir SRC'; $link = new Link(self::LINK_NAME, $testString); $this->assertSame(self::LINK_NAME, $link->getName()); $this->assertSame($testString, $link->getString()); - $this->assertSame('https://github.com/phalcon/zephir', $link->getUri()); + $this->assertSame('https://github.com/zephir-lang/zephir', $link->getUri()); } public function testShouldGetLinkText(): void { - $testString = 'https://github.com/phalcon/zephir Zephir SRC'; + $testString = 'https://github.com/zephir-lang/zephir Zephir SRC'; $link = new Link(self::LINK_NAME, $testString); diff --git a/tests/Zephir/Documentation/Annotation/SeeTest.php b/tests/Zephir/Documentation/Annotation/SeeTest.php index 02ae82715f..0d52f1b1c6 100644 --- a/tests/Zephir/Documentation/Annotation/SeeTest.php +++ b/tests/Zephir/Documentation/Annotation/SeeTest.php @@ -37,18 +37,18 @@ public function testShouldGetLink(): void public function testShouldGetResource(): void { - $testString = 'https://github.com/phalcon/zephir Zephir SRC'; + $testString = 'https://github.com/zephir-lang/zephir Zephir SRC'; $link = new See(self::SEE_NAME, $testString); $this->assertSame(self::SEE_NAME, $link->getName()); $this->assertSame($testString, $link->getString()); - $this->assertSame('https://github.com/phalcon/zephir', $link->getResource()); + $this->assertSame('https://github.com/zephir-lang/zephir', $link->getResource()); } public function testShouldGetText(): void { - $testString = 'https://github.com/phalcon/zephir Zephir SRC'; + $testString = 'https://github.com/zephir-lang/zephir Zephir SRC'; $link = new See(self::SEE_NAME, $testString); diff --git a/tests/Zephir/Documentation/DocblockParserTest.php b/tests/Zephir/Documentation/DocblockParserTest.php index c4dc4b34ce..137f61fd38 100644 --- a/tests/Zephir/Documentation/DocblockParserTest.php +++ b/tests/Zephir/Documentation/DocblockParserTest.php @@ -31,8 +31,8 @@ public function testShouldParseDocblockFromString(): void * * Helper to parse raw docblocks to structured object. * - * @link https://github.com/phalcon/zephir - Zephir - * @see https://github.com/phalcon/zephir/README.md - Zephir readme + * @link https://github.com/zephir-lang/zephir - Zephir + * @see https://github.com/zephir-lang/zephir/README.md - Zephir readme * * @param array \$annotation - custom annotation * @@ -40,10 +40,10 @@ public function testShouldParseDocblockFromString(): void */ DOC; - $link = new Link('link', 'https://github.com/phalcon/zephir - Zephir'); + $link = new Link('link', 'https://github.com/zephir-lang/zephir - Zephir'); $link->getLinkText(); - $see = new See('see', 'https://github.com/phalcon/zephir/README.md - Zephir readme'); + $see = new See('see', 'https://github.com/zephir-lang/zephir/README.md - Zephir readme'); $see->getResource(); $return = new ReturnAnnotation('return', 'Docblock the parsed docblock'); diff --git a/tests/Zephir/Documentation/DocblockTest.php b/tests/Zephir/Documentation/DocblockTest.php index 846940ba1c..d29aa2f8fe 100644 --- a/tests/Zephir/Documentation/DocblockTest.php +++ b/tests/Zephir/Documentation/DocblockTest.php @@ -28,7 +28,7 @@ protected function setUp(): void public function testShouldGetAllProperties(): void { - $annotation1 = new Annotation('see', 'https://github.com/phalcon/zephir Zephir homepage'); + $annotation1 = new Annotation('see', 'https://github.com/zephir-lang/zephir Zephir homepage'); $annotation2 = new Annotation('link', 'https://github.com/phalcon/cphalcon Phalcon homepage'); $this->docblock->setAnnotations([ @@ -58,7 +58,7 @@ public function testShouldGetAllProperties(): void public function testShouldAddAnnotations(): void { - $annotation1 = new Annotation('see', 'https://github.com/phalcon/zephir Zephir homepage'); + $annotation1 = new Annotation('see', 'https://github.com/zephir-lang/zephir Zephir homepage'); $annotation2 = new Annotation('link', 'https://github.com/phalcon/cphalcon Phalcon homepage'); $annotation3 = new Annotation('readme', 'https://github.com/zephir/README.md Readme'); @@ -81,14 +81,14 @@ public function testShouldGenerateDocblock(): void * * Example description block. * - * @see https://github.com/phalcon/zephir Zephir homepage + * @see https://github.com/zephir-lang/zephir Zephir homepage * @return void * DOC; $this->docblock->setDescription('Example description block.'); $this->docblock->setSummary('Example summary block.'); $this->docblock->setAnnotations([ - new Annotation('see', 'https://github.com/phalcon/zephir Zephir homepage'), + new Annotation('see', 'https://github.com/zephir-lang/zephir Zephir homepage'), ]); $this->docblock->addAnnotation( new Annotation('return', 'void') diff --git a/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php b/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php index 4df2445ffe..cda80e7caf 100644 --- a/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php +++ b/tests/Zephir/Optimizers/FunctionCall/PregMatchOptimizerTest.php @@ -45,7 +45,7 @@ protected function setUp(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfNoParametersGiven(): void { @@ -62,7 +62,7 @@ public function testShouldThrowExceptionIfNoParametersGiven(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfParametersLessThanRequired(): void { @@ -79,7 +79,7 @@ public function testShouldThrowExceptionIfParametersLessThanRequired(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfParametersMoreThanRequired(): void { @@ -96,7 +96,7 @@ public function testShouldThrowExceptionIfParametersMoreThanRequired(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfMatchedIsNotVariable(): void { @@ -121,7 +121,7 @@ public function testShouldThrowExceptionIfMatchedIsNotVariable(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfUsedUndefinedMatchesVariable(): void { @@ -157,7 +157,7 @@ public function testShouldThrowExceptionIfUsedUndefinedMatchesVariable(): void } /** - * @issue https://github.com/phalcon/zephir/issues/1697 + * @issue https://github.com/zephir-lang/zephir/issues/1697 */ public function testShouldThrowExceptionIfMatchesHasUnexpectedType(): void { diff --git a/tests/Zephir/Stubs/DocBlockTest.php b/tests/Zephir/Stubs/DocBlockTest.php index 4e9ed10f8f..63684b5b91 100644 --- a/tests/Zephir/Stubs/DocBlockTest.php +++ b/tests/Zephir/Stubs/DocBlockTest.php @@ -194,7 +194,7 @@ public function testPhpDocWithVariousDocBlockTags(): void * @author Phalcon Team * @copyright (c) 2013-present Phalcon Team (https://zephir-lang.com/) * @license MIT http://zephir-lang.com/license.html - * @link https://github.com/phalcon/zephir + * @link https://github.com/zephir-lang/zephir * @since 1.0.0 * @todo Something * @uses MyClass::function doSmthName @@ -211,7 +211,7 @@ public function testPhpDocWithVariousDocBlockTags(): void * @author Phalcon Team * @copyright (c) 2013-present Phalcon Team (https://zephir-lang.com/) * @license MIT http://zephir-lang.com/license.html - * @link https://github.com/phalcon/zephir + * @link https://github.com/zephir-lang/zephir * @since 1.0.0 * @todo Something * @uses MyClass::function doSmthName diff --git a/tests/fixtures/typehints/typehints/retval.zep b/tests/fixtures/typehints/typehints/retval.zep index 3c5b484162..eb1d4a2e85 100644 --- a/tests/fixtures/typehints/typehints/retval.zep +++ b/tests/fixtures/typehints/typehints/retval.zep @@ -6,36 +6,36 @@ class RetVal { * However, the language specification does not prohibit it. * Therefore, we must test and verify the expected result. * - * @link https://github.com/phalcon/zephir/pull/1681 + * @link https://github.com/zephir-lang/zephir/pull/1681 * @var \Some\Non\Existent\Class\At\This\Time */ protected my_var = "some-value" {get}; /** - * @link https://github.com/phalcon/zephir/pull/1681 + * @link https://github.com/zephir-lang/zephir/pull/1681 * @var string */ protected my_string = "some-value" {get}; /** - * @link https://github.com/phalcon/zephir/pull/1685 + * @link https://github.com/zephir-lang/zephir/pull/1685 * @var array */ protected my_array {get}; - /** @link https://github.com/phalcon/zephir/pull/1681 */ + /** @link https://github.com/zephir-lang/zephir/pull/1681 */ public function retval_var_var() -> var { var _var; return _var; } - /** @link https://github.com/phalcon/zephir/pull/1681 */ + /** @link https://github.com/zephir-lang/zephir/pull/1681 */ public function retval_var_var_builit_1() -> var|string { var _var; return _var; } - /** @link https://github.com/phalcon/zephir/pull/1681 */ + /** @link https://github.com/zephir-lang/zephir/pull/1681 */ public function retval_var_var_builit_2() -> int|var { var _var; return _var; @@ -75,7 +75,7 @@ class RetVal { return []; } - /** @link https://github.com/phalcon/zephir/issues/1779 */ + /** @link https://github.com/zephir-lang/zephir/issues/1779 */ public function retval_array_of_objects() -> <\stdClass[]> { return []; } @@ -135,13 +135,13 @@ class RetVal { } } -/** @link https://github.com/phalcon/zephir/pull/1681 */ +/** @link https://github.com/zephir-lang/zephir/pull/1681 */ function retval_var_var_builit_1() -> var|string { var _var; return _var; } -/** @link https://github.com/phalcon/zephir/pull/1681 */ +/** @link https://github.com/zephir-lang/zephir/pull/1681 */ function retval_var_var_builit_2() -> int|var { var _var; return _var; @@ -219,7 +219,7 @@ function retval_object_or_scalar() -> <\stdClass> | bool { return false; } -/** @link https://github.com/phalcon/zephir/issues/1779 */ +/** @link https://github.com/zephir-lang/zephir/issues/1779 */ function retval_array_of_objects() -> <\stdClass[]> { return []; } diff --git a/tests/sharness/t0002-generate.sh b/tests/sharness/t0002-generate.sh index 53d0a4e574..651f4ccb2a 100755 --- a/tests/sharness/t0002-generate.sh +++ b/tests/sharness/t0002-generate.sh @@ -23,7 +23,7 @@ test_expect_success "Life Cycle Test" " test_cmp ext/lifecycle.c expected3.c " -# See: https://github.com/phalcon/zephir/issues/1758 +# See: https://github.com/zephir-lang/zephir/issues/1758 test_expect_success "Should generate valid code with inheritance of prototype interfaces" " cd $FIXTURESDIR/protodir && zephirc fullclean 2>&1 >/dev/null && diff --git a/tests/sharness/t0005-stubs.sh b/tests/sharness/t0005-stubs.sh index 89f0f9f8fe..086aa412f2 100755 --- a/tests/sharness/t0005-stubs.sh +++ b/tests/sharness/t0005-stubs.sh @@ -23,11 +23,11 @@ fi test_expect_success "Should generate Stubs" \ "zephir_stubs && test -d ./ide/0.0.1/Stubs" -# See: https://github.com/phalcon/zephir/issues/1922 +# See: https://github.com/zephir-lang/zephir/issues/1922 test_expect_success "Should properly generate type hint" \ "test_cmp expected/Issue_1922.zep.php ide/0.0.1/Stubs/Issue_1922.zep.php" -# See: https://github.com/phalcon/zephir/issues/1778 +# See: https://github.com/zephir-lang/zephir/issues/1778 test_expect_success "Should properly namespace imports (use block)" \ "test_cmp expected/Issue_1778.zep.php ide/0.0.1/Stubs/Issue_1778.zep.php" @@ -36,15 +36,15 @@ if test_have_prereq PHP70; then else expected="Issue_1900.zep.php" fi -# See: https://github.com/phalcon/zephir/issues/1900 +# See: https://github.com/zephir-lang/zephir/issues/1900 test_expect_success "Should properly generate return types for stubs" \ "test_cmp expected/$expected ide/0.0.1/Stubs/Issue_1900.zep.php" -# See: https://github.com/phalcon/zephir/issues/1907 +# See: https://github.com/zephir-lang/zephir/issues/1907 test_expect_success "Should properly generate Namespace for extends" \ "test_cmp expected/Exception.zep.php ide/0.0.1/Stubs/Exception.zep.php" -# See: https://github.com/phalcon/zephir/issues/1907 +# See: https://github.com/zephir-lang/zephir/issues/1907 test_expect_success "Should properly generate Namespace for extends (slash)" \ "test_cmp expected/Issue_1907.zep.php ide/0.0.1/Stubs/Issue_1907.zep.php" @@ -53,15 +53,15 @@ if test_have_prereq PHP70; then else expected="Issue_1986.zep.php" fi -# See: https://github.com/phalcon/zephir/issues/1986 +# See: https://github.com/zephir-lang/zephir/issues/1986 test_expect_success "Should properly generate Aliases for use statements" \ "test_cmp expected/$expected ide/0.0.1/Stubs/Issue_1986.zep.php" -# See: https://github.com/phalcon/zephir/issues/1896 +# See: https://github.com/zephir-lang/zephir/issues/1896 test_expect_success "Should generage CamelCase folders for stubs" \ "test $(ls ./ide/0.0.1/Stubs/Events/ManagerInterface.zep.php | sed -e 's~\/~\\~g') = .\ide\0.0.1\Stubs\Events\ManagerInterface.zep.php" -# See: https://github.com/phalcon/zephir/issues/2026 +# See: https://github.com/zephir-lang/zephir/issues/2026 test_expect_success "Should properly generate return type for Collections" \ "test_cmp expected/Issue_2026.zep.php ide/0.0.1/Stubs/Issue_2026.zep.php" @@ -70,7 +70,7 @@ if test_have_prereq PHP70; then else expected="Issue_2092.zep.php" fi -# See: https://github.com/phalcon/zephir/issues/2092 +# See: https://github.com/zephir-lang/zephir/issues/2092 test_expect_success "Should properly generate return type for type hinted object" \ "test_cmp expected/$expected ide/0.0.1/Stubs/Issue_2092.zep.php"