Best Gherkin-php code snippet using AstNodeTest
ASTVariableDeclaratorTest.php
Source:ASTVariableDeclaratorTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once 'PHP/Depend/Code/ASTNodeTest.php';49require_once 'PHP/Depend/Code/ASTVariableDeclarator.php';50/**51 * Test case for the {@link PHP_Depend_Code_ASTVariableDeclarator} class.52 *53 * @category PHP54 * @package PHP_Depend55 * @subpackage Code56 * @author Manuel Pichler <mapi@pdepend.org>57 * @copyright 2008-2009 Manuel Pichler. All rights reserved.58 * @license http://www.opensource.org/licenses/bsd-license.php BSD License59 * @version Release: 0.9.760 * @link http://www.pdepend.org/61 */62class PHP_Depend_Code_ASTVariableDeclaratorTest extends PHP_Depend_Code_ASTNodeTest63{64 /**65 * Tests that the declaration has the expected start line value.66 *67 * @return void68 */69 public function testVariableDeclaratorHasExpectedStartLine()70 {71 $packages = self::parseTestCaseSource(__METHOD__);72 $function = $packages->current()73 ->getFunctions()74 ->current();75 $declarators = $function->findChildrenOfType(76 PHP_Depend_Code_ASTVariableDeclarator::CLAZZ77 );78 $this->assertSame(4, $declarators[0]->getStartLine());79 $this->assertSame(5, $declarators[1]->getStartLine());80 }81 /**82 * Tests that the declaration has the expected start column value.83 *84 * @return void85 */86 public function testVariableDeclaratorHasExpectedStartColumn()87 {88 $packages = self::parseTestCaseSource(__METHOD__);89 $function = $packages->current()90 ->getFunctions()91 ->current();92 $declarators = $function->findChildrenOfType(93 PHP_Depend_Code_ASTVariableDeclarator::CLAZZ94 );95 $this->assertSame(12, $declarators[0]->getStartColumn());96 $this->assertSame(5, $declarators[1]->getStartColumn());97 }98 /**99 * Tests that the declaration has the expected end line value.100 *101 * @return void102 */103 public function testVariableDeclaratorHasExpectedEndLine()104 {105 $packages = self::parseTestCaseSource(__METHOD__);106 $function = $packages->current()107 ->getFunctions()108 ->current();109 $declarator = $function->getFirstChildOfType(110 PHP_Depend_Code_ASTVariableDeclarator::CLAZZ111 );112 $this->assertSame(7, $declarator->getEndLine());113 }114 /**115 * Tests that the declaration has the expected end column value.116 *117 * @return void118 */119 public function testVariableDeclaratorHasExpectedEndColumn()120 {121 $packages = self::parseTestCaseSource(__METHOD__);122 $function = $packages->current()123 ->getFunctions()124 ->current();125 $declarator = $function->getFirstChildOfType(126 PHP_Depend_Code_ASTVariableDeclarator::CLAZZ127 );128 $this->assertSame(17, $declarator->getEndColumn());129 }130 /**131 * Creates a field declaration node.132 *133 * @return PHP_Depend_Code_ASTVariableDeclarator134 */135 protected function createNodeInstance()136 {137 return new PHP_Depend_Code_ASTVariableDeclarator('$foo');138 }139}140?>...
ASTStaticVariableDeclarationTest.php
Source:ASTStaticVariableDeclarationTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once 'PHP/Depend/Code/ASTNodeTest.php';49/**50 * Test case for the {@link PHP_Depend_Code_ASTStaticVariableDeclaration} class.51 *52 * @category PHP53 * @package PHP_Depend54 * @subpackage Code55 * @author Manuel Pichler <mapi@pdepend.org>56 * @copyright 2008-2009 Manuel Pichler. All rights reserved.57 * @license http://www.opensource.org/licenses/bsd-license.php BSD License58 * @version Release: 0.9.759 * @link http://www.pdepend.org/60 */61class PHP_Depend_Code_ASTStaticVariableDeclarationTest extends PHP_Depend_Code_ASTNodeTest62{63 /**64 * Tests that the declaration has the expected start line value.65 * 66 * @return void67 */68 public function testStaticVariableDeclarationHasExpectedStartLine()69 {70 $packages = self::parseTestCaseSource(__METHOD__);71 $function = $packages->current()72 ->getFunctions()73 ->current();74 $declaration = $function->getFirstChildOfType(75 PHP_Depend_Code_ASTStaticVariableDeclaration::CLAZZ76 );77 $this->assertSame(4, $declaration->getStartLine());78 }79 /**80 * Tests that the declaration has the expected start column value.81 *82 * @return void83 */84 public function testStaticVariableDeclarationHasExpectedStartColumn()85 {86 $packages = self::parseTestCaseSource(__METHOD__);87 $function = $packages->current()88 ->getFunctions()89 ->current();90 $declaration = $function->getFirstChildOfType(91 PHP_Depend_Code_ASTStaticVariableDeclaration::CLAZZ92 );93 $this->assertSame(5, $declaration->getStartColumn());94 }95 /**96 * Tests that the declaration has the expected end line value.97 *98 * @return void99 */100 public function testStaticVariableDeclarationHasExpectedEndLine()101 {102 $packages = self::parseTestCaseSource(__METHOD__);103 $function = $packages->current()104 ->getFunctions()105 ->current();106 $declaration = $function->getFirstChildOfType(107 PHP_Depend_Code_ASTStaticVariableDeclaration::CLAZZ108 );109 $this->assertSame(5, $declaration->getEndLine());110 }111 /**112 * Tests that the declaration has the expected end column value.113 *114 * @return void115 */116 public function testStaticVariableDeclarationHasExpectedEndColumn()117 {118 $packages = self::parseTestCaseSource(__METHOD__);119 $function = $packages->current()120 ->getFunctions()121 ->current();122 $declaration = $function->getFirstChildOfType(123 PHP_Depend_Code_ASTStaticVariableDeclaration::CLAZZ124 );125 $this->assertSame(23, $declaration->getEndColumn());126 }127 /**128 * Creates a static variable declaration node.129 *130 * @return PHP_Depend_Code_ASTStaticVariableDeclaration131 */132 protected function createNodeInstance()133 {134 return new PHP_Depend_Code_ASTStaticVariableDeclaration(__FUNCTION__);135 }136}...
ASTConstantPostfixTest.php
Source:ASTConstantPostfixTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once dirname(__FILE__) . '/ASTNodeTest.php';49require_once 'PHP/Depend/Code/ASTConstantPostfix.php';50/**51 * Test case for the {@link PHP_Depend_Code_ASTConstantPostfix} class.52 *53 * @category PHP54 * @package PHP_Depend55 * @subpackage Code56 * @author Manuel Pichler <mapi@pdepend.org>57 * @copyright 2008-2009 Manuel Pichler. All rights reserved.58 * @license http://www.opensource.org/licenses/bsd-license.php BSD License59 * @version Release: 0.9.760 * @link http://www.pdepend.org/61 */62class PHP_Depend_Code_ASTConstantPostfixTest extends PHP_Depend_Code_ASTNodeTest63{64 /**65 * Tests that a parsed constant postfix has the expected object structure.66 *67 * @return void68 */69 public function testConstantPostfixStructureForSimpleStaticAccess()70 {71 $packages = self::parseTestCaseSource(__METHOD__);72 $function = $packages->current()73 ->getFunctions()74 ->current();75 $prefix = $function->getFirstChildOfType(76 PHP_Depend_Code_ASTMemberPrimaryPrefix::CLAZZ77 );78 $reference = $prefix->getChild(0);79 $this->assertType(PHP_Depend_Code_ASTClassOrInterfaceReference::CLAZZ, $reference);80 $this->assertSame('Bar', $reference->getImage());81 $postfix = $prefix->getChild(1);82 $this->assertType(PHP_Depend_Code_ASTConstantPostfix::CLAZZ, $postfix);83 $this->assertSame('BAZ', $postfix->getImage());84 $identifier = $postfix->getChild(0);85 $this->assertType(PHP_Depend_Code_ASTIdentifier::CLAZZ, $identifier);86 $this->assertSame('BAZ', $identifier->getImage());87 }88 /**89 * Tests that a parsed method postfix has the expected object structure.90 *91 * @return void92 */93 public function testConstantPostfixStructureForStaticAccessOnVariable()94 {95 $packages = self::parseTestCaseSource(__METHOD__);96 $function = $packages->current()97 ->getFunctions()98 ->current();99 $prefix = $function->getFirstChildOfType(100 PHP_Depend_Code_ASTMemberPrimaryPrefix::CLAZZ101 );102 $variable = $prefix->getChild(0);103 $this->assertType(PHP_Depend_Code_ASTVariable::CLAZZ, $variable);104 $this->assertSame('::', $prefix->getImage());105 $postfix = $prefix->getChild(1);106 $this->assertType(PHP_Depend_Code_ASTConstantPostfix::CLAZZ, $postfix);107 $identifier = $postfix->getChild(0);108 $this->assertType(PHP_Depend_Code_ASTIdentifier::CLAZZ, $identifier);109 }110 /**111 * Creates a constant postfix node.112 *113 * @return PHP_Depend_Code_ASTConstantPostfix114 */115 protected function createNodeInstance()116 {117 return new PHP_Depend_Code_ASTConstantPostfix(__FUNCTION__);118 }119}...
ASTConstantTest.php
Source:ASTConstantTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once dirname(__FILE__) . '/ASTNodeTest.php';49require_once 'PHP/Depend/Code/ASTConstant.php';50/**51 * Test case for the {@link PHP_Depend_Code_ASTConstant} class.52 *53 * @category PHP54 * @package PHP_Depend55 * @subpackage Code56 * @author Manuel Pichler <mapi@pdepend.org>57 * @copyright 2008-2009 Manuel Pichler. All rights reserved.58 * @license http://www.opensource.org/licenses/bsd-license.php BSD License59 * @version Release: 0.9.760 * @link http://www.pdepend.org/61 */62class PHP_Depend_Code_ASTConstantTest extends PHP_Depend_Code_ASTNodeTest63{64 /**65 * Tests that a parsed constant has the expected object graph.66 *67 * @return void68 */69 public function testConstantGraphSimple()70 {71 $packages = self::parseTestCaseSource(__METHOD__);72 $function = $packages73 ->current()74 ->getFunctions()75 ->current();76 $constant = $function->getFirstChildOfType(77 PHP_Depend_Code_ASTConstant::CLAZZ78 );79 80 $this->assertType(PHP_Depend_Code_ASTConstant::CLAZZ, $constant);81 $this->assertSame('FOO', $constant->getImage());82 }83 /**84 * Tests that a parsed constant has the expected object graph.85 *86 * @return void87 */88 public function testConstantGraphKeywordSelf()89 {90 $packages = self::parseTestCaseSource(__METHOD__);91 $function = $packages92 ->current()93 ->getFunctions()94 ->current();95 $constant = $function->getFirstChildOfType(96 PHP_Depend_Code_ASTConstant::CLAZZ97 );98 $this->assertType(PHP_Depend_Code_ASTConstant::CLAZZ, $constant);99 $this->assertSame('self', $constant->getImage());100 }101 /**102 * Tests that a parsed constant has the expected object graph.103 *104 * @return void105 */106 public function testConstantGraphKeywordParent()107 {108 $packages = self::parseTestCaseSource(__METHOD__);109 $function = $packages110 ->current()111 ->getFunctions()112 ->current();113 $constant = $function->getFirstChildOfType(114 PHP_Depend_Code_ASTConstant::CLAZZ115 );116 $this->assertType(PHP_Depend_Code_ASTConstant::CLAZZ, $constant);117 $this->assertSame('parent', $constant->getImage());118 }119 /**120 * Creates a constant postfix node.121 *122 * @return PHP_Depend_Code_ASTConstant123 */124 protected function createNodeInstance()125 {126 return new PHP_Depend_Code_ASTConstant(__FUNCTION__);127 }128}...
ASTStaticReferenceTest.php
Source:ASTStaticReferenceTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once dirname(__FILE__) . '/ASTNodeTest.php';49require_once 'PHP/Depend/Code/ASTStaticReference.php';50require_once 'PHP/Depend/Code/Class.php';51/**52 * Test case for the {@link PHP_Depend_Code_ASTStaticReference} class.53 *54 * @category PHP55 * @package PHP_Depend56 * @subpackage Code57 * @author Manuel Pichler <mapi@pdepend.org>58 * @copyright 2008-2009 Manuel Pichler. All rights reserved.59 * @license http://www.opensource.org/licenses/bsd-license.php BSD License60 * @version Release: 0.9.761 * @link http://www.pdepend.org/62 */63class PHP_Depend_Code_ASTStaticReferenceTest extends PHP_Depend_Code_ASTNodeTest64{65 /**66 * Tests that an invalid static results in the expected exception.67 *68 * @return void69 */70 public function testStaticReferenceAllocationOutsideOfClassScopeThrowsExpectedException()71 {72 $this->setExpectedException(73 'PHP_Depend_Parser_InvalidStateException',74 'The keyword "static" was used outside of a class/method scope.'75 );76 $packages = self::parseTestCaseSource(__METHOD__);77 }78 /**79 * Tests that an invalid static results in the expected exception.80 *81 * @return void82 */83 public function testStaticReferenceMemberPrimaryPrefixOutsideOfClassScopeThrowsExpectedException()84 {85 $this->setExpectedException(86 'PHP_Depend_Parser_InvalidStateException',87 'The keyword "static" was used outside of a class/method scope.'88 );89 $packages = self::parseTestCaseSource(__METHOD__);90 }91 /**92 * Creates a concrete node implementation.93 *94 * @return PHP_Depend_Code_ASTStaticReference95 */96 protected function createNodeInstance()97 {98 return new PHP_Depend_Code_ASTStaticReference(99 $this->getMock(100 'PHP_Depend_Code_Class',101 array(),102 array(__CLASS__)103 )104 );105 }106}...
ASTLiteralTest.php
Source:ASTLiteralTest.php
1<?php2/**3 * This file is part of PHP_Depend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2009, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @category PHP40 * @package PHP_Depend41 * @subpackage Code42 * @author Manuel Pichler <mapi@pdepend.org>43 * @copyright 2008-2009 Manuel Pichler. All rights reserved.44 * @license http://www.opensource.org/licenses/bsd-license.php BSD License45 * @version SVN: $Id$46 * @link http://www.pdepend.org/47 */48require_once dirname(__FILE__) . '/ASTNodeTest.php';49require_once 'PHP/Depend/Code/ASTLiteral.php';50/**51 * Test case for the {@link PHP_Depend_Code_ASTLiteral} class.52 *53 * @category PHP54 * @package PHP_Depend55 * @subpackage Code56 * @author Manuel Pichler <mapi@pdepend.org>57 * @copyright 2008-2009 Manuel Pichler. All rights reserved.58 * @license http://www.opensource.org/licenses/bsd-license.php BSD License59 * @version Release: 0.9.760 * @link http://www.pdepend.org/61 */62class PHP_Depend_Code_ASTLiteralTest extends PHP_Depend_Code_ASTNodeTest63{64 /**65 * Tests that an invalid literal results in the expected exception.66 * 67 * @return void68 */69 public function testUnclosedDoubleQuoteStringResultsInExpectedException()70 {71 $this->setExpectedException('PHP_Depend_Parser_TokenStreamEndException');72 self::parseTestCaseSource(__METHOD__);73 }74 /**75 * Creates a literal node.76 *77 * @return PHP_Depend_Code_ASTLiteral78 */79 protected function createNodeInstance()80 {81 return new PHP_Depend_Code_ASTLiteral("'" . __METHOD__ . "'");82 }83}...
ASTNodeTest.php
Source:ASTNodeTest.php
1<?php2/**3 * This file is part of PHP Mess Detector.4 *5 * Copyright (c) Manuel Pichler <mapi@phpmd.org>.6 * All rights reserved.7 *8 * Licensed under BSD License9 * For full copyright and license information, please see the LICENSE file.10 * Redistributions of files must retain the above copyright notice.11 *12 * @author Manuel Pichler <mapi@phpmd.org>13 * @copyright Manuel Pichler. All rights reserved.14 * @license https://opensource.org/licenses/bsd-license.php BSD License15 * @link http://phpmd.org/16 */17namespace PHPMD\Node;18use PHPMD\AbstractTest;19/**20 * Test case for the {@link \PHPMD\Node\ASTNode} class.21 *22 * @covers \PHPMD\Node\ASTNode23 */24class ASTNodeTest extends AbstractTest25{26 /**27 * testGetImageDelegatesToGetImageMethodOfWrappedNode28 *29 * @return void30 */31 public function testGetImageDelegatesToGetImageMethodOfWrappedNode()32 {33 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));34 $mock->expects($this->once())35 ->method('getImage');36 $node = new ASTNode($mock, __FILE__);37 $node->getImage();38 }39 /**40 * testGetNameDelegatesToGetImageMethodOfWrappedNode41 *42 * @return void43 */44 public function testGetNameDelegatesToGetImageMethodOfWrappedNode()45 {46 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));47 $mock->expects($this->once())48 ->method('getImage');49 $node = new ASTNode($mock, __FILE__);50 $node->getName();51 }52 /**53 * testHasSuppressWarningsAnnotationForAlwaysReturnsFalse54 *55 * @return void56 */57 public function testHasSuppressWarningsAnnotationForAlwaysReturnsFalse()58 {59 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));60 $node = new ASTNode($mock, __FILE__);61 $rule = $this->getRuleMock();62 $this->assertFalse($node->hasSuppressWarningsAnnotationFor($rule));63 }64 /**65 * testGetParentNameReturnsNull66 *67 * @return void68 */69 public function testGetParentNameReturnsNull()70 {71 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));72 $node = new ASTNode($mock, __FILE__);73 $this->assertNull($node->getParentName());74 }75 /**76 * testGetNamespaceNameReturnsNull77 *78 * @return void79 */80 public function testGetNamespaceNameReturnsNull()81 {82 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));83 $node = new ASTNode($mock, __FILE__);84 $this->assertNull($node->getNamespaceName());85 }86 /**87 * testGetFullQualifiedNameReturnsNull88 *89 * @return void90 */91 public function testGetFullQualifiedNameReturnsNull()92 {93 $mock = $this->getMockFromBuilder($this->getMockBuilder('PDepend\Source\AST\ASTNode'));94 $node = new ASTNode($mock, __FILE__);95 $this->assertNull($node->getFullQualifiedName());96 }97}...
ASTPrimitiveTypeTest.php
Source:ASTPrimitiveTypeTest.php
1<?php2/**3 * This file is part of PDepend.4 *5 * PHP Version 56 *7 * Copyright (c) 2008-2013, Manuel Pichler <mapi@pdepend.org>.8 * All rights reserved.9 *10 * Redistribution and use in source and binary forms, with or without11 * modification, are permitted provided that the following conditions12 * are met:13 *14 * * Redistributions of source code must retain the above copyright15 * notice, this list of conditions and the following disclaimer.16 *17 * * Redistributions in binary form must reproduce the above copyright18 * notice, this list of conditions and the following disclaimer in19 * the documentation and/or other materials provided with the20 * distribution.21 *22 * * Neither the name of Manuel Pichler nor the names of his23 * contributors may be used to endorse or promote products derived24 * from this software without specific prior written permission.25 *26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS29 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE30 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,31 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,32 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;33 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER34 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN36 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE37 * POSSIBILITY OF SUCH DAMAGE.38 *39 * @copyright 2008-2013 Manuel Pichler. All rights reserved.40 * @license http://www.opensource.org/licenses/bsd-license.php BSD License41 */42namespace PDepend\Source\AST;43/**44 * Test case for the {@link \PDepend\Source\AST\ASTPrimitiveType} class.45 *46 * @copyright 2008-2013 Manuel Pichler. All rights reserved.47 * @license http://www.opensource.org/licenses/bsd-license.php BSD License48 *49 * @covers \PDepend\Source\Language\PHP\AbstractPHPParser50 * @covers \PDepend\Source\AST\ASTPrimitiveType51 * @group unittest52 */53class ASTPrimitiveTypeTest extends \PDepend\Source\AST\ASTNodeTest54{55 /**56 * testIsArrayReturnsFalse57 *58 * @return void59 */60 public function testIsArrayReturnsFalse()61 {62 $type = new \PDepend\Source\AST\ASTPrimitiveType();63 $this->assertFalse($type->isArray());64 }65 /**66 * testIsPrimitiveReturnsTrue67 *68 * @return void69 */70 public function testIsPrimitiveReturnsTrue()71 {72 $type = new \PDepend\Source\AST\ASTPrimitiveType();73 $this->assertTrue($type->isPrimitive());74 }75}...
AstNodeTest
Using AI Code Generation
1require_once 'vendor/autoload.php';2use Behat\Gherkin\Node\FeatureNode;3use Behat\Gherkin\Node\ScenarioNode;4use Behat\Gherkin\Node\StepNode;5use Behat\Gherkin\Node\TableNode;6use Behat\Gherkin\Node\PyStringNode;7use Behat\Gherkin\Node\BackgroundNode;8use Behat\Gherkin\Node\OutlineNode;9use Behat\Gherkin\Node\ExampleTableNode;10use Behat\Gherkin\Node\ExampleNode;11use Behat\Gherkin\Node\StepContainerInterface;12use Behat\Gherkin\Node\FeatureInterface;13use Behat\Gherkin\Node\ScenarioLikeInterface;14use Behat\Gherkin\Node\ScenarioInterface;15use Behat\Gherkin\Node\StepInterface;16use Behat\Gherkin\Node\BackgroundInterface;17use Behat\Gherkin\Node\OutlineInterface;18use Behat\Gherkin\Node\ExampleInterface;19use Behat\Gherkin\Node\StepArgumentInterface;20use Behat\Gherkin\Node\AstNode;21use Behat\Gherkin\Node\AstNodeInterface;22use Behat\Gherkin\Node\AstNodeTest;23$feature = new FeatureNode(24 new TagNode('tag'),25 new BackgroundNode(26 new StepNode(27 new ScenarioNode(
AstNodeTest
Using AI Code Generation
1require_once __DIR__ . '/vendor/autoload.php';2use Behat\Gherkin\Node\FeatureNode;3use Behat\Gherkin\Node\ScenarioNode;4use Behat\Gherkin\Node\StepNode;5use Behat\Gherkin\Node\TableNode;6use Behat\Gherkin\Node\PyStringNode;7use Behat\Gherkin\Keywords\KeywordsInterface;8use Behat\Gherkin\Keywords\ArrayKeywords;9use Behat\Gherkin\Keywords\Keywords;10use Behat\Gherkin\Keywords\LanguageKeywords;11use Behat\Gherkin\Keywords\EnglishKeywords;12use Behat\Gherkin\Keywords\ChineseKeywords;13use Behat\Gherkin\Keywords\ChineseTraditionalKeywords;14use Behat\Gherkin\Keywords\JapaneseKeywords;15use Behat\Gherkin\Keywords\RussianKeywords;16use Behat\Gherkin\Keywords\GermanKeywords;17use Behat\Gherkin\Keywords\SpanishKeywords;18use Behat\Gherkin\Keywords\FrenchKeywords;19use Behat\Gherkin\Keywords\ItalianKeywords;20use Behat\Gherkin\Keywords\KoreanKeywords;21use Behat\Gherkin\Keywords\PortugueseKeywords;22use Behat\Gherkin\Keywords\SwedishKeywords;23use Behat\Gherkin\Keywords\TurkishKeywords;24use Behat\Gherkin\Keywords\UkrainianKeywords;25use Behat\Gherkin\Keywords\ArabicKeywords;26use Behat\Gherkin\Keywords\PolishKeywords;27use Behat\Gherkin\Keywords\NorwegianKeywords;28use Behat\Gherkin\Keywords\DanishKeywords;29use Behat\Gherkin\Keywords\DutchKeywords;30use Behat\Gherkin\Keywords\IndonesianKeywords;31use Behat\Gherkin\Keywords\SwahiliKeywords;32use Behat\Gherkin\Keywords\HungarianKeywords;33use Behat\Gherkin\Keywords\RomanianKeywords;34use Behat\Gherkin\Keywords\CzechKeywords;35use Behat\Gherkin\Keywords\GreekKeywords;36use Behat\Gherkin\Keywords\HebrewKeywords;37use Behat\Gherkin\Keywords\IcelandicKeywords;
AstNodeTest
Using AI Code Generation
1require_once __DIR__ . '/vendor/autoload.php';2use Behat\Gherkin\Node\PyStringNode;3use Behat\Gherkin\Node\TableNode;4use Behat\Gherkin\Node\FeatureNode;5use Behat\Gherkin\Node\BackgroundNode;6use Behat\Gherkin\Node\ScenarioNode;7use Behat\Gherkin\Node\StepNode;8use Behat\Gherkin\Keywords\KeywordsInterface;9use Behat\Gherkin\Keywords\ArrayKeywords;10use Behat\Gherkin\Loader\GherkinFileLoader;11use Behat\Gherkin\Loader\GherkinStringLoader;12use Behat\Gherkin\Loader\LoaderInterface;13use Behat\Gherkin\Loader\LoaderResolver;14use Behat\Gherkin\Parser;15use Behat\Gherkin\Lexer;16use Behat\Gherkin\Filter\LineRangeFilter;17use Behat\Gherkin\Filter\TagFilter;18use Behat\Gherkin\Filter\FeatureNameFilter;19use Behat\Gherkin\Filter\FeatureDescriptionFilter;20use Behat\Gherkin\Filter\ScenarioNameFilter;21use Behat\Gherkin\Filter\StepFilter;22use Behat\Gherkin\Filter\FilterInterface;23use Behat\Gherkin\Filter\ChainFilter;24use Behat\Gherkin\Filter\EmptyFilter;25use Behat\Gherkin\Filter\CompositeFilter;26use Behat\Gherkin\Filter\NameFilter;27use Behat\Gherkin\Filter\DescriptionFilter;28use Behat\Gherkin\Filter\FeatureFilter;29use Behat\Gherkin\Filter\ScenarioFilter;30use Behat\Gherkin\Filter\StepKeywordFilter;
AstNodeTest
Using AI Code Generation
1require_once 'vendor/autoload.php';2use Behat\Gherkin\Loader\GherkinFileLoader;3use Behat\Gherkin\Node\FeatureNode;4use Behat\Gherkin\Node\ScenarioNode;5use Behat\Gherkin\Node\StepNode;6use Behat\Gherkin\Node\BackgroundNode;7use Behat\Gherkin\Node\PyStringNode;8use Behat\Gherkin\Node\TableNode;9use Behat\Gherkin\Node\OutlineNode;10use Behat\Gherkin\Node\ExampleNode;11use Behat\Gherkin\Node\TagNode;12use Behat\Gherkin\Node\FeatureNode;13use Behat\Gherkin\Node\AstNode;14use Behat\Gherkin\Node\FeatureNode;15use Behat\Gherkin\Node\ScenarioNode;16use Behat\Gherkin\Node\StepNode;17use Behat\Gherkin\Node\BackgroundNode;18use Behat\Gherkin\Node\PyStringNode;19use Behat\Gherkin\Node\TableNode;20use Behat\Gherkin\Node\OutlineNode;21use Behat\Gherkin\Node\ExampleNode;22use Behat\Gherkin\Node\TagNode;23use Behat\Gherkin\Node\FeatureNode;24use Behat\Gherkin\Node\AstNode;25use Behat\Gherkin\Node\FeatureNode;26use Behat\Gherkin\Node\ScenarioNode;27use Behat\Gherkin\Node\StepNode;28use Behat\Gherkin\Node\BackgroundNode;29use Behat\Gherkin\Node\PyStringNode;30use Behat\Gherkin\Node\TableNode;31use Behat\Gherkin\Node\OutlineNode;32use Behat\Gherkin\Node\ExampleNode;33use Behat\Gherkin\Node\TagNode;34use Behat\Gherkin\Node\FeatureNode;35use Behat\Gherkin\Node\AstNode;36use Behat\Gherkin\Node\FeatureNode;37use Behat\Gherkin\Node\ScenarioNode;38use Behat\Gherkin\Node\StepNode;
AstNodeTest
Using AI Code Generation
1use Behat\Gherkin\Node\PyStringNode;2use Behat\Gherkin\Node\TableNode;3use Behat\MinkExtension\Context\MinkContext;4use Behat\Behat\Context\SnippetAcceptingContext;5use Behat\Behat\Context\Step;6use Behat\Behat\Context\Step\Given;7use Behat\Behat\Tester\Exception\PendingException;8use Behat\Behat\Context\Step\Then;9use Behat\Behat\Context\Step\When;10use Behat\Behat\Context\Context;11use Behat\Behat\Hook\Scope\AfterStepScope;12use Behat\Gherkin\Node\FeatureNode;13use Behat\Gherkin\Node\ScenarioInterface;14{15 protected $output;16 protected $features = array();17 protected $scenarios = array();18 protected $steps = array();19 protected $passed = 0;20 protected $failed = 0;21 protected $skipped = 0;22 protected $undefined = 0;23 protected $pending = 0;24 protected $background = 0;25 protected $currentFeature = '';26 protected $currentScenario = '';27 protected $currentStep = '';28 protected $currentStatus = '';29 protected $currentException = '';30 protected $currentExceptionTrace = '';31 protected $currentExceptionScreenshot = '';32 protected $currentExceptionScreenshotName = '';33 protected $currentExceptionScreenshotPath = '';34 protected $currentExceptionScreenshotUrl = '';35 protected $currentExceptionScreenshotBase64 = '';36 protected $currentExceptionScreenshotBase64Name = '';37 protected $currentExceptionScreenshotBase64Path = '';38 protected $currentExceptionScreenshotBase64Url = '';39 protected $currentExceptionScreenshotBase64Raw = '';40 protected $currentExceptionScreenshotBase64RawName = '';41 protected $currentExceptionScreenshotBase64RawPath = '';42 protected $currentExceptionScreenshotBase64RawUrl = '';43 protected $currentExceptionScreenshotBase64RawSize = '';44 protected $currentExceptionScreenshotBase64RawType = '';45 protected $currentExceptionScreenshotBase64RawExtension = '';46 protected $currentExceptionScreenshotBase64RawMimeType = '';
AstNodeTest
Using AI Code Generation
1require_once __DIR__ . '/vendor/autoload.php';2use Behat\Gherkin\Keywords\ArrayKeywords;3use Behat\Gherkin\Keywords\KeywordsInterface;4use Behat\Gherkin\Keywords\KeywordsDumper;5$keywords = new ArrayKeywords(array(6 'en' => array(7 'ru' => array(8 'fr' => array(9 'nl' => array(
AstNodeTest
Using AI Code Generation
1require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Parser.php';2require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Lexer.php';3require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsInterface.php';4require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/Keywords.php';5require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsEn.php';6require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsFr.php';7require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsZh.php';8require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsJp.php';9require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsRu.php';10require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsDe.php';11require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsIt.php';12require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsPt.php';13require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsNl.php';14require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsEs.php';15require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsNo.php';16require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsPl.php';17require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsTr.php';18require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsCz.php';19require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsSe.php';20require_once 'vendor/Behat/Gherkin/src/Behat/Gherkin/Keywords/KeywordsFi.php';
AstNodeTest
Using AI Code Generation
1include "src/AstNodeTest.php";2use Gherkin\Gherkin;3use Gherkin\Ast\FeatureNode;4use Gherkin\Ast\ScenarioNode;5use Gherkin\Ast\StepNode;6use Gherkin\Ast\DataTableNode;7use Gherkin\Ast\DocStringNode;8use Gherkin\Ast\BackgroundNode;9use Gherkin\Ast\ExamplesNode;10use Gherkin\Ast\OutlineNode;11use Gherkin\Ast\StepArgumentInterface;12use Gherkin\Ast\TagNode;13use Gherkin\Ast\CommentNode;14use Gherkin\Ast\PyStringNode;15use Gherkin\Ast\TableRowNode;16use Gherkin\Ast\Location;17use Gherkin\Ast\GherkinDocument;18use Gherkin\Ast\ScenarioDefinitionNode;19use Gherkin\Ast\RuleNode;20use Gherkin\Ast\ExampleNode;21use Gherkin\Ast\ExamplesTableNode;22use Gherkin\Ast\FeatureHeaderNode;23use Gherkin\Ast\FeatureChildNode;24use Gherkin\Ast\FeatureDescriptionNode;25use Gherkin\Ast\FeatureTagsNode;26use Gherkin\Ast\ScenarioDefinitionInterface;27use Gherkin\Ast\ScenarioInterface;28use Gherkin\Ast\BackgroundInterface;29use Gherkin\Ast\StepContainerInterface;30use Gherkin\Ast\ScenarioDefinitionType;31use Gherkin\Ast\StepType;32use Gherkin\Ast\ScenarioOutlineNode;33use Gherkin\Ast\ExamplesInterface;34use Gherkin\Ast\StepInterface;35use Gherkin\Ast\BackgroundNode;36use Gherkin\Ast\ScenarioNode;37use Gherkin\Ast\ScenarioOutlineNode;38use Gherkin\Ast\RuleInterface;39use Gherkin\Ast\RuleHeaderNode;40use Gherkin\Ast\RuleChildNode;41use Gherkin\Ast\RuleDescriptionNode;42use Gherkin\Ast\RuleTagsNode;43use Gherkin\Ast\RuleTagsInterface;44use Gherkin\Ast\RuleHeaderInterface;45use Gherkin\Ast\RuleDescriptionInterface;46use Gherkin\Ast\RuleChildInterface;47use Gherkin\Ast\RuleInterface;
AstNodeTest
Using AI Code Generation
1include_once('Gherkin.php');2$gherkin = new Gherkin();3$gherkin->parse('1.feature');4print_r($gherkin->getAst());5echo $gherkin->getFeatureName();6echo $gherkin->getFeatureDescription();7print_r($gherkin->getFeatureTags());8echo $gherkin->getScenarioName();9echo $gherkin->getScenarioDescription();10print_r($gherkin->getScenarioTags());11print_r($gherkin->getSteps());12print_r($gherkin->getStepNames());13print_r($gherkin->getStepTypes());14print_r($gherkin->getStepArguments());15print_r($gherkin->getStepArgumentTypes());16print_r($gherkin->getStepArgumentContents());17print_r($gherkin->getStepArgumentRows());18print_r($gherkin->getStepArgumentRowsAsString());19print_r($gherkin->getStepArgumentRowsAsTable());
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!