404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.217.104.36: ~ $
<?php

/*
 * This file is part of Psy Shell.
 *
 * (c) 2012-2023 Justin Hileman
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Psy\Test\CodeCleaner;

use Psy\CodeCleaner\AbstractClassPass;

class AbstractClassPassTest extends CodeCleanerTestCase
{
    /**
     * @before
     */
    public function getReady()
    {
        $this->setPass(new AbstractClassPass());
    }

    /**
     * @dataProvider invalidStatements
     */
    public function testProcessStatementFails($code)
    {
        $this->expectException(\Psy\Exception\FatalErrorException::class);
        $this->parseAndTraverse($code);

        $this->fail();
    }

    public function invalidStatements()
    {
        return [
            ['class A { abstract function a(); }'],
            ['abstract class B { abstract function b() {} }'],
            ['abstract class B { abstract function b() { echo "yep"; } }'],
        ];
    }

    /**
     * @dataProvider validStatements
     */
    public function testProcessStatementPasses($code)
    {
        $this->parseAndTraverse($code);
        $this->assertTrue(true);
    }

    public function validStatements()
    {
        return [
            ['abstract class C { function c() {} }'],
            ['abstract class D { abstract function d(); }'],
        ];
    }
}

Filemanager

Name Type Size Permission Actions
Fixtures Folder 0755
AbstractClassPassTest.php File 1.42 KB 0644
AssignThisVariablePassTest.php File 1.32 KB 0644
CallTimePassByReferencePassTest.php File 1.37 KB 0644
CalledClassPassTest.php File 2.71 KB 0644
CodeCleanerTestCase.php File 961 B 0644
EmptyArrayDimFetchPassTest.php File 1.41 KB 0644
ExitPassTest.php File 1.98 KB 0644
FinalClassPassTest.php File 1.52 KB 0644
FunctionContextPassTest.php File 1.26 KB 0644
FunctionReturnInWriteContextPassTest.php File 1.82 KB 0644
ImplicitReturnPassTest.php File 2.12 KB 0644
InstanceOfPassTest.php File 2.84 KB 0644
IssetPassTest.php File 3.24 KB 0644
LabelContextPassTest.php File 2.16 KB 0644
LeavePsyshAlonePassTest.php File 1.63 KB 0644
ListPassTest.php File 3.67 KB 0644
LoopContextPassTest.php File 3.57 KB 0644
MagicConstantsPassTest.php File 866 B 0644
NamespacePassTest.php File 1.92 KB 0644
NoReturnValueTest.php File 786 B 0644
PassableByReferencePassTest.php File 3 KB 0644
RequirePassTest.php File 2.89 KB 0644
ReturnTypePassTest.php File 3.65 KB 0644
StrictTypesPassTest.php File 1.31 KB 0644
UseStatementPassTest.php File 3.36 KB 0644
ValidClassNamePassTest.php File 10.1 KB 0644
ValidConstructorPassTest.php File 2.68 KB 0644
ValidFunctionNamePassTest.php File 4.78 KB 0644