Best Phpunit code snippet using TestSuite
obsolete_paths.php
Source:obsolete_paths.php
1<?php2/**3 * Obsolete pathes4 *5 * Format: array(<path>[, <replacement>])6 *7 * Copyright © Magento, Inc. All rights reserved.8 * See COPYING.txt for license details.9 */10return [11 ['/app/code/core/Mage', '/app/code/Magento'],12 ['/lib/Magento/App', '/lib/Magento/Framework/App'],13 ['/dev/tests/integration/testsuite/Magento/App', '/dev/tests/integration/testsuite/Magento/Framework/App'],14 ['/dev/tests/unit/testsuite/Magento/App', '/dev/tests/unit/testsuite/Magento/Framework/App'],15 ['/lib/Magento/Data', '/lib/Magento/Framework/Data'],16 ['/dev/tests/integration/testsuite/Magento/Data', '/dev/tests/integration/testsuite/Magento/Framework/Data'],17 ['/dev/tests/unit/testsuite/Magento/Data', '/dev/tests/unit/testsuite/Magento/Framework/Data'],18 ['/lib/Magento/Filesystem', '/lib/Magento/Framework/Filesystem'],19 [20 '/dev/tests/integration/testsuite/Magento/Filesystem',21 '/dev/tests/integration/testsuite/Magento/Framework/Filesystem'22 ],23 ['/dev/tests/unit/testsuite/Magento/Filesystem', '/dev/tests/unit/testsuite/Magento/Framework/Filesystem'],24 ['/lib/Magento/Config', '/lib/Magento/Framework/Config'],25 ['/lib/Magento/Model', '/lib/Magento/Framework/Model'],26 ['/dev/tests/integration/testsuite/Magento/Model', '/dev/tests/integration/testsuite/Magento/Framework/Model'],27 ['/dev/tests/unit/testsuite/Magento/Model', '/dev/tests/unit/testsuite/Magento/Framework/Model'],28 ['/lib/Magento/View', '/lib/Magento/Framework/View'],29 ['/dev/tests/integration/testsuite/Magento/View', '/dev/tests/integration/testsuite/Magento/Framework/View'],30 ['/dev/tests/unit/testsuite/Magento/View', '/dev/tests/unit/testsuite/Magento/Framework/View'],31 ['/lib/Magento/DB', '/lib/Magento/Framework/DB'],32 ['/dev/tests/integration/testsuite/Magento/DB', '/dev/tests/integration/testsuite/Magento/Framework/DB'],33 ['/dev/tests/unit/testsuite/Magento/DB', '/dev/tests/unit/testsuite/Magento/Framework/DB'],34 ['/lib/Magento/Event', '/lib/Magento/Framework/Event'],35 ['/dev/tests/integration/testsuite/Magento/Event', '/dev/tests/integration/testsuite/Magento/Framework/Event'],36 ['/dev/tests/unit/testsuite/Magento/Event', '/dev/tests/unit/testsuite/Magento/Framework/Event'],37 ['/lib/Magento/Acl', '/lib/Magento/Framework/Acl'],38 ['/dev/tests/integration/testsuite/Magento/Acl', '/dev/tests/integration/testsuite/Magento/Framework/Acl'],39 ['/dev/tests/unit/testsuite/Magento/Acl', '/dev/tests/unit/testsuite/Magento/Framework/Acl'],40 ['/lib/Magento/Archive', '/lib/Magento/Framework/Archive'],41 [42 '/dev/tests/integration/testsuite/Magento/Archive',43 '/dev/tests/integration/testsuite/Magento/Framework/Archive'44 ],45 ['/dev/tests/unit/testsuite/Magento/Archive', '/dev/tests/unit/testsuite/Magento/Framework/Archive'],46 ['/lib/Magento/Backup', '/lib/Magento/Framework/Backup'],47 ['/lib/Magento/Session', '/lib/Magento/Framework/Session'],48 [49 '/dev/tests/integration/testsuite/Magento/Session',50 '/dev/tests/integration/testsuite/Magento/Framework/Session'51 ],52 ['/dev/tests/unit/testsuite/Magento/Session', '/dev/tests/unit/testsuite/Magento/Framework/Session'],53 ['/lib/Magento/Authorization', '/lib/Magento/Framework/Authorization'],54 ['/lib/Magento/Cache', '/lib/Magento/Framework/Cache'],55 ['/dev/tests/integration/testsuite/Magento/Cache', '/dev/tests/integration/testsuite/Magento/Framework/Cache'],56 ['/dev/tests/unit/testsuite/Magento/Cache', '/dev/tests/unit/testsuite/Magento/Framework/Cache'],57 ['/lib/Magento/ObjectManager', '/lib/Magento/Framework/ObjectManager'],58 [59 '/dev/tests/integration/testsuite/Magento/ObjectManager',60 '/dev/tests/integration/testsuite/Magento/Framework/ObjectManager'61 ],62 ['/dev/tests/unit/testsuite/Magento/ObjectManager', '/dev/tests/unit/testsuite/Magento/Framework/ObjectManager'],63 ['/lib/Magento/Exception', '/lib/Magento/Framework/Exception'],64 [65 '/dev/tests/integration/testsuite/Magento/Exception',66 '/dev/tests/integration/testsuite/Magento/Framework/Exception'67 ],68 ['/dev/tests/unit/testsuite/Magento/Exception', '/dev/tests/unit/testsuite/Magento/Framework/Exception'],69 ['/lib/Magento/Autoload', '/lib/Magento/Framework/Autoload'],70 [71 '/dev/tests/integration/testsuite/Magento/Autoload',72 '/dev/tests/integration/testsuite/Magento/Framework/Autoload'73 ],74 ['/dev/tests/unit/testsuite/Magento/Autoload', '/dev/tests/unit/testsuite/Magento/Framework/Autoload'],75 ['/lib/Magento/Translate', '/lib/Magento/Framework/Translate'],76 [77 '/dev/tests/integration/testsuite/Magento/Translate',78 '/dev/tests/integration/testsuite/Magento/Framework/Translate'79 ],80 ['/dev/tests/unit/testsuite/Magento/Translate', '/dev/tests/unit/testsuite/Magento/Framework/Translate'],81 ['/lib/Magento/Code', '/lib/Magento/Framework/Code'],82 ['/dev/tests/integration/testsuite/Magento/Code', '/dev/tests/integration/testsuite/Magento/Framework/Code'],83 ['/dev/tests/unit/testsuite/Magento/Code', '/dev/tests/unit/testsuite/Magento/Framework/Code'],84 ['/lib/Magento/Stdlib', '/lib/Magento/Framework/Stdlib'],85 ['/dev/tests/integration/testsuite/Magento/Stdlib', '/dev/tests/integration/testsuite/Magento/Framework/Stdlib'],86 ['/dev/tests/unit/testsuite/Magento/Stdlib', '/dev/tests/unit/testsuite/Magento/Framework/Stdlib'],87 ['/lib/Magento/Phrase', '/lib/Magento/Framework/Phrase'],88 ['/dev/tests/integration/testsuite/Magento/Phrase', '/dev/tests/integration/testsuite/Magento/Framework/Phrase'],89 ['/dev/tests/unit/testsuite/Magento/Phrase', '/dev/tests/unit/testsuite/Magento/Framework/Phrase'],90 ['/lib/Magento/Locale', '/lib/Magento/Framework/Locale'],91 ['/dev/tests/integration/testsuite/Magento/Locale', '/dev/tests/integration/testsuite/Magento/Framework/Locale'],92 ['/dev/tests/unit/testsuite/Magento/Locale', '/dev/tests/unit/testsuite/Magento/Framework/Locale'],93 ['/lib/Magento/Message', '/lib/Magento/Framework/Message'],94 ['/dev/tests/integration/testsuite/Magento/Message', '/dev/tests/integration/testsuite/Magento/Framework/Message'],95 ['/dev/tests/unit/testsuite/Magento/Message', '/dev/tests/unit/testsuite/Magento/Framework/Message'],96 ['/lib/Magento/Logger', '/lib/Magento/Framework/Logger'],97 ['/dev/tests/integration/testsuite/Magento/Logger', '/dev/tests/integration/testsuite/Magento/Framework/Logger'],98 ['/dev/tests/unit/testsuite/Magento/Logger', '/dev/tests/unit/testsuite/Magento/Framework/Logger'],99 ['/lib/Magento/Error', '/lib/Magento/Framework/Error'],100 ['/dev/tests/integration/testsuite/Magento/Error', '/dev/tests/integration/testsuite/Magento/Framework/Error'],101 ['/dev/tests/unit/testsuite/Magento/Error', '/dev/tests/unit/testsuite/Magento/Framework/Error'],102 ['/lib/Magento/Filter', '/lib/Magento/Framework/Filter'],103 ['/dev/tests/integration/testsuite/Magento/Filter', '/dev/tests/integration/testsuite/Magento/Framework/Filter'],104 ['/dev/tests/unit/testsuite/Magento/Filter', '/dev/tests/unit/testsuite/Magento/Framework/Filter'],105 ['/lib/Magento/DomDocument', '/lib/Magento/Framework/DomDocument'],106 [107 '/dev/tests/integration/testsuite/Magento/DomDocument',108 '/dev/tests/integration/testsuite/Magento/Framework/DomDocument'109 ],110 ['/dev/tests/unit/testsuite/Magento/DomDocument', '/dev/tests/unit/testsuite/Magento/Framework/DomDocument'],111 ['/lib/Magento/Module', '/lib/Magento/Framework/Module'],112 ['/dev/tests/integration/testsuite/Magento/Module', '/dev/tests/integration/testsuite/Magento/Framework/Module'],113 ['/dev/tests/unit/testsuite/Magento/Module', '/dev/tests/unit/testsuite/Magento/Framework/Module'],114 ['/lib/Magento/Css', '/lib/Magento/Framework/Css'],115 ['/dev/tests/integration/testsuite/Magento/Css', '/dev/tests/integration/testsuite/Magento/Framework/Css'],116 ['/dev/tests/unit/testsuite/Magento/Css', '/dev/tests/unit/testsuite/Magento/Framework/Css'],117 ['/lib/Magento/Pear', '/lib/Magento/Framework/Pear'],118 ['/dev/tests/integration/testsuite/Magento/Pear', '/dev/tests/integration/testsuite/Magento/Framework/Pear'],119 ['/dev/tests/unit/testsuite/Magento/Pear', '/dev/tests/unit/testsuite/Magento/Framework/Pear'],120 ['/lib/Magento/Pricing', '/lib/Magento/Framework/Pricing'],121 ['/dev/tests/integration/testsuite/Magento/Pricing', '/dev/tests/integration/testsuite/Magento/Framework/Pricing'],122 ['/dev/tests/unit/testsuite/Magento/Pricing', '/dev/tests/unit/testsuite/Magento/Framework/Pricing'],123 ['/lib/Magento/Connect'],124 ['/lib/Magento/Framework/Connect'],125 ['/lib/internal/Magento/Framework/Connect'],126 ['/lib/Magento/Profiler', '/lib/Magento/Framework/Profiler'],127 ['/dev/tests/unit/testsuite/Magento/Profiler', '/dev/tests/unit/testsuite/Magento/Framework/Profiler'],128 [129 '/dev/tests/integration/testsuite/Magento/Profiler',130 '/dev/tests/integration/testsuite/Magento/Framework/Profiler'131 ],132 ['/lib/Magento/Simplexml', '/lib/Magento/Framework/Simplexml'],133 ['/dev/tests/unit/testsuite/Magento/Simplexml', '/dev/tests/unit/testsuite/Magento/Framework/Simplexml'],134 [135 '/dev/tests/integration/testsuite/Magento/Simplexml',136 '/dev/tests/integration/testsuite/Magento/Framework/Simplexml'137 ],138 ['/lib/Magento/Controller', '/lib/Magento/Framework/Controller'],139 [140 '/dev/tests/integration/testsuite/Magento/Controller',141 '/dev/tests/integration/testsuite/Magento/Framework/Controller'142 ],143 ['/dev/tests/unit/testsuite/Magento/Controller', '/dev/tests/unit/testsuite/Magento/Framework/Controller'],144 ['/lib/Magento/Convert', '/lib/Magento/Framework/Convert'],145 ['/dev/tests/integration/testsuite/Magento/Convert', '/dev/tests/integration/testsuite/Magento/Framework/Convert'],146 ['/dev/tests/unit/testsuite/Magento/Convert', '/dev/tests/unit/testsuite/Magento/Framework/Convert'],147 ['/lib/Magento/Shell', '/lib/Magento/Framework/Shell'],148 ['/dev/tests/unit/testsuite/Magento/Shell', '/dev/tests/unit/testsuite/Magento/Framework/Shell'],149 ['/dev/tests/integration/testsuite/Magento/Shell', '/dev/tests/integration/testsuite/Magento/Framework/Shell'],150 ['/lib/Magento/Encryption', '/lib/Magento/Framework/Encryption'],151 [152 '/dev/tests/integration/testsuite/Magento/Encryption',153 '/dev/tests/integration/testsuite/Magento/Framework/Encryption'154 ],155 ['/dev/tests/unit/testsuite/Magento/Encryption', '/dev/tests/unit/testsuite/Magento/Framework/Encryption'],156 ['/lib/Magento/Option', '/lib/Magento/Framework/Option'],157 ['/dev/tests/unit/testsuite/Magento/Option', '/dev/tests/unit/testsuite/Magento/Framework/Option'],158 ['/dev/tests/integration/testsuite/Magento/Option', '/dev/tests/integration/testsuite/Magento/Framework/Option'],159 ['/lib/Magento/Service', '/lib/Magento/Framework/Api'],160 ['/dev/tests/unit/testsuite/Magento/Service', '/dev/tests/unit/testsuite/Magento/Framework/Api'],161 ['/dev/tests/integration/testsuite/Magento/Service', '/dev/tests/integration/testsuite/Magento/Framework/Api'],162 ['/lib/Magento/System', '/lib/Magento/Framework/System'],163 ['/dev/tests/unit/testsuite/Magento/System', '/dev/tests/unit/testsuite/Magento/Framework/System'],164 ['/dev/tests/integration/testsuite/Magento/System', '/dev/tests/integration/testsuite/Magento/Framework/System'],165 ['/lib/Magento/Url', '/lib/Magento/Framework/Url'],166 ['/dev/tests/unit/testsuite/Magento/Url', '/dev/tests/unit/testsuite/Magento/Framework/Url'],167 ['/dev/tests/integration/testsuite/Magento/Url', '/dev/tests/integration/testsuite/Magento/Framework/Url'],168 ['/lib/Magento/Mview', '/lib/Magento/Framework/Mview'],169 ['/dev/tests/unit/testsuite/Magento/Mview', '/dev/tests/unit/testsuite/Magento/Framework/Mview'],170 ['/dev/tests/integration/testsuite/Magento/Mview', '/dev/tests/integration/testsuite/Magento/Framework/Mview'],171 ['/lib/Magento/Validator', '/lib/Magento/Framework/Validator'],172 ['/dev/tests/unit/testsuite/Magento/Validator', '/dev/tests/unit/testsuite/Magento/Framework/Validator'],173 [174 '/dev/tests/integration/testsuite/Magento/Validator',175 '/dev/tests/integration/testsuite/Magento/Framework/Validator'176 ],177 ['/lib/Magento/Xml', '/lib/Magento/Framework/Xml'],178 ['/dev/tests/unit/testsuite/Magento/Xml', '/dev/tests/unit/testsuite/Magento/Framework/Xml'],179 ['/dev/tests/integration/testsuite/Magento/Xml', '/dev/tests/integration/testsuite/Magento/Framework/Xml'],180 ['/lib/Magento/Interception', '/lib/Magento/Framework/Interception'],181 ['/dev/tests/unit/testsuite/Magento/Interception', '/dev/tests/unit/testsuite/Magento/Framework/Interception'],182 [183 '/dev/tests/integration/testsuite/Magento/Interception',184 '/dev/tests/integration/testsuite/Magento/Framework/Interception'185 ],186 ['/lib/Magento/Json', '/lib/Magento/Framework/Json'],187 ['/dev/tests/unit/testsuite/Magento/Json', '/dev/tests/unit/testsuite/Magento/Framework/Json'],188 ['/dev/tests/integration/testsuite/Magento/Json', '/dev/tests/integration/testsuite/Magento/Framework/Json'],189 ['/lib/Magento/Less', '/lib/Magento/Framework/Less'],190 ['/dev/tests/unit/testsuite/Magento/Less', '/dev/tests/unit/testsuite/Magento/Framework/Less'],191 ['/dev/tests/integration/testsuite/Magento/Less', '/dev/tests/integration/testsuite/Magento/Framework/Less'],192 ['/lib/Magento/File', '/lib/Magento/Framework/File'],193 ['/dev/tests/unit/testsuite/Magento/File', '/dev/tests/unit/testsuite/Magento/Framework/File'],194 ['/dev/tests/integration/testsuite/Magento/File', '/dev/tests/integration/testsuite/Magento/Framework/File'],195 ['/lib/Magento/Flag', '/lib/Magento/Framework/Flag'],196 ['/dev/tests/unit/testsuite/Magento/Flag', '/dev/tests/unit/testsuite/Magento/Framework/Flag'],197 ['/dev/tests/integration/testsuite/Magento/Flag', '/dev/tests/integration/testsuite/Magento/Framework/Flag'],198 ['/lib/Magento/Io', '/lib/Magento/Framework/Io'],199 ['/dev/tests/unit/testsuite/Magento/Io', '/dev/tests/unit/testsuite/Magento/Framework/Io'],200 ['/dev/tests/integration/testsuite/Magento/Io', '/dev/tests/integration/testsuite/Magento/Framework/Io'],201 ['/lib/Magento/Mail', '/lib/Magento/Framework/Mail'],202 ['/dev/tests/unit/testsuite/Magento/Mail', '/dev/tests/unit/testsuite/Magento/Framework/Mail'],203 ['/dev/tests/integration/testsuite/Magento/Mail', '/dev/tests/integration/testsuite/Magento/Framework/Mail'],204 ['/lib/Magento/HTTP', '/lib/Magento/Framework/HTTP'],205 ['/dev/tests/unit/testsuite/Magento/Http', '/dev/tests/unit/testsuite/Magento/Framework/HTTP'],206 ['/dev/tests/integration/testsuite/Magento/HTTP', '/dev/tests/integration/testsuite/Magento/Framework/HTTP'],207 ['/lib/Magento/Math', '/lib/Magento/Framework/Math'],208 ['/dev/tests/unit/testsuite/Magento/Math', '/dev/tests/unit/testsuite/Magento/Framework/Math'],209 ['/dev/tests/integration/testsuite/Magento/Math', '/dev/tests/integration/testsuite/Magento/Framework/Math'],210 ['/lib/Magento/Gdata', '/lib/Magento/Framework/Gdata'],211 ['/dev/tests/unit/testsuite/Magento/Gdata', '/dev/tests/unit/testsuite/Magento/Framework/Gdata'],212 ['/dev/tests/integration/testsuite/Magento/Gdata', '/dev/tests/integration/testsuite/Magento/Framework/Gdata'],213 ['/lib/Magento/Image', '/lib/Magento/Framework/Image'],214 ['/dev/tests/unit/testsuite/Magento/Image', '/dev/tests/unit/testsuite/Magento/Framework/Image'],215 ['/dev/tests/integration/testsuite/Magento/Image', '/dev/tests/integration/testsuite/Magento/Framework/Image'],216 ['/lib/Magento/Oauth', '/lib/Magento/Framework/Oauth'],217 ['/dev/tests/unit/testsuite/Magento/Oauth', '/dev/tests/unit/testsuite/Magento/Framework/Oauth'],218 ['/dev/tests/integration/testsuite/Magento/Oauth', '/dev/tests/integration/testsuite/Magento/Framework/Oauth'],219 ['/lib/Magento/Object', '/lib/Magento/Framework/Object'],220 ['/dev/tests/unit/testsuite/Magento/Object', '/dev/tests/unit/testsuite/Magento/Framework/Object'],221 ['/dev/tests/integration/testsuite/Magento/Object', '/dev/tests/integration/testsuite/Magento/Framework/Object'],222 ['/dev/tests/unit/testsuite/Magento/Core/Model/View/Url', '/dev/tests/unit/testsuite/Magento/Framework/View/Url'],223 ['/app/code/Magento/Core/Model/View/Url', '/lib/internal/Magento/Framework/View/Url'],224 ['/downloader'],225 ['/app/code/Magento/Core/Model/Design/Backend', '/app/code/Magento/Theme/Model/Design/Backend'],226 [227 '/dev/tests/integration/testsuite/Magento/Core/Model/Design/Backend',228 '/dev/tests/integration/testsuite/Magento/Theme/Model/Design/Backend'229 ],230 ['/app/code/Magento/Core/Model/Resource/Theme', '/app/code/Magento/Theme/Model/Resource/Theme'],231 [232 '/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Theme',233 '/dev/tests/integration/testsuite/Magento/Theme/Model/Resource/Theme'234 ],235 ['/dev/tests/unit/testsuite/Magento/Webapi/Service/Entity'],236 ['/app/code/Magento/Install'],237 ['/dev/tests/integration/testsuite/Magento/Install'],238 ['/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Install'],239 ['/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/InstallWizardConfigFilesTest.php'],240 ['/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Install'],241 ['/dev/tests/unit/testsuite/Magento/Install'],242 ['/dev/shell/install.php'],243 ['/dev/shell/uninstall.php'],244 ['/app/design/install'],245 ['/app/etc/local.xml', '/app/etc/config.php'],246 ['/app/code/Magento/RecurringPayment'],247 ['/app/code/Magento/PayPalRecurringPayment'],248 ['/app/code/Magento/Weee/Model/Total/Quote/Nominal/Weee.php'],249 ['/app/code/Magento/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php'],250 ['/app/code/Magento/Tax/Model/Sales/Total/Quote/Nominal/Tax.php'],251 ['/app/code/Magento/SalesRule/Model/Quote/Nominal/Discount.php'],252 ['/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal.php'],253 ['/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal'],254 ['/app/code/Magento/Checkout/Block/Total/Nominal.php'],255 ['/app/code/Magento/Checkout/etc/sales.xml'],256 ['/app/code/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php'],257 ['/dev/tests/unit/testsuite/Magento/Core/Model/TemplateEngine/Decorator/DebugHints.php'],258 ['/dev/tests/unit/testsuite'],259 ['/app/code/Magento/Log'],260 ['/app/code/Magento/DesignEditor'],261 ['/dev/tools/Magento/Tools/Migration'],262 ['/dev/shell/dependency.php'],263 ['/dev/tests/performance'],264];...
TestSuiteIteratorTest.php
Source:TestSuiteIteratorTest.php
...10namespace PHPUnit\Framework;11/**12 * @small13 */14final class TestSuiteIteratorTest extends TestCase15{16 /*17 * tests for the initial state with empty test suite18 */19 public function testKeyForEmptyTestSuiteInitiallyReturnsZero(): void20 {21 $testSuite = new TestSuite();22 $subject = new TestSuiteIterator($testSuite);23 $this->assertSame(0, $subject->key());24 }25 public function testValidForEmptyTestSuiteInitiallyReturnsFalse(): void26 {27 $testSuite = new TestSuite();28 $subject = new TestSuiteIterator($testSuite);29 $this->assertFalse($subject->valid());30 }31 public function testCurrentForEmptyTestSuiteInitiallyReturnsNull(): void32 {33 $testSuite = new TestSuite();34 $subject = new TestSuiteIterator($testSuite);35 $this->assertNull($subject->current());36 }37 /*38 * tests for the initial state with non-empty test suite39 */40 public function testKeyForNonEmptyTestSuiteInitiallyReturnsZero(): void41 {42 $testSuite = new TestSuite();43 $testSuite->addTest(new \EmptyTestCaseTest());44 $subject = new TestSuiteIterator($testSuite);45 $this->assertSame(0, $subject->key());46 }47 public function testValidForNonEmptyTestSuiteInitiallyReturnsTrue(): void48 {49 $testSuite = new TestSuite();50 $testSuite->addTest(new \EmptyTestCaseTest());51 $subject = new TestSuiteIterator($testSuite);52 $this->assertTrue($subject->valid());53 }54 public function testCurrentForNonEmptyTestSuiteInitiallyReturnsFirstTest(): void55 {56 $test = new \EmptyTestCaseTest();57 $testSuite = new TestSuite();58 $testSuite->addTest($test);59 $subject = new TestSuiteIterator($testSuite);60 $this->assertSame($test, $subject->current());61 }62 /*63 * tests for rewind64 */65 public function testRewindResetsKeyToZero(): void66 {67 $testSuite = new TestSuite();68 $testSuite->addTest(new \EmptyTestCaseTest());69 $subject = new TestSuiteIterator($testSuite);70 $subject->next();71 $subject->rewind();72 $this->assertSame(0, $subject->key());73 }74 public function testRewindResetsCurrentToFirstElement(): void75 {76 $testSuite = new TestSuite();77 $test = new \EmptyTestCaseTest();78 $testSuite->addTest($test);79 $subject = new TestSuiteIterator($testSuite);80 $subject->next();81 $subject->rewind();82 $this->assertSame($test, $subject->current());83 }84 /*85 * tests for next86 */87 public function testNextIncreasesKeyFromZeroToOne(): void88 {89 $testSuite = new TestSuite();90 $testSuite->addTest(new \EmptyTestCaseTest());91 $subject = new TestSuiteIterator($testSuite);92 $subject->next();93 $this->assertSame(1, $subject->key());94 }95 public function testCurrentAfterLastElementReturnsNull(): void96 {97 $testSuite = new TestSuite();98 $testSuite->addTest(new \EmptyTestCaseTest());99 $subject = new TestSuiteIterator($testSuite);100 $subject->next();101 $this->assertNull($subject->current());102 }103 public function testValidAfterLastElementReturnsFalse(): void104 {105 $testSuite = new TestSuite();106 $testSuite->addTest(new \EmptyTestCaseTest());107 $subject = new TestSuiteIterator($testSuite);108 $subject->next();109 $this->assertFalse($subject->valid());110 }111 /*112 * tests for getChildren113 */114 public function testGetChildrenForEmptyTestSuiteThrowsException(): void115 {116 $testSuite = new TestSuite();117 $subject = new TestSuiteIterator($testSuite);118 $this->expectException(UnexpectedValueException::class);119 $subject->getChildren();120 }121 public function testGetChildrenForCurrentTestThrowsException(): void122 {123 $testSuite = new TestSuite();124 $testSuite->addTest(new \EmptyTestCaseTest());125 $subject = new TestSuiteIterator($testSuite);126 $this->expectException(UnexpectedValueException::class);127 $subject->getChildren();128 }129 public function testGetChildrenReturnsNewInstanceWithCurrentTestSuite(): void130 {131 $childSuite = new TestSuite();132 $test = new \EmptyTestCaseTest();133 $childSuite->addTest($test);134 $testSuite = new TestSuite();135 $testSuite->addTest($childSuite);136 $subject = new TestSuiteIterator($testSuite);137 $children = $subject->getChildren();138 $this->assertNotSame($subject, $children);139 $this->assertSame($test, $children->current());140 }141 /*142 * tests for hasChildren143 */144 public function testHasChildrenForCurrentTestSuiteReturnsTrue(): void145 {146 $testSuite = new TestSuite();147 $childSuite = new TestSuite();148 $testSuite->addTest($childSuite);149 $subject = new TestSuiteIterator($testSuite);150 $this->assertTrue($subject->hasChildren());151 }152 public function testHasChildrenForCurrentTestReturnsFalse(): void153 {154 $testSuite = new TestSuite();155 $test = new \EmptyTestCaseTest();156 $testSuite->addTest($test);157 $subject = new TestSuiteIterator($testSuite);158 $this->assertFalse($subject->hasChildren());159 }160 public function testHasChildrenForNoTestsReturnsFalse(): void161 {162 $testSuite = new TestSuite();163 $subject = new TestSuiteIterator($testSuite);164 $this->assertFalse($subject->hasChildren());165 }166}...
TestSuite
Using AI Code Generation
1require_once 'PHPUnit/Framework/TestSuite.php';2require_once 'PHPUnit/Framework/TestCase.php';3require_once 'PHPUnit/Framework/TestResult.php';4require_once 'PHPUnit/TextTestRunner.php';5require_once 'PHPUnit/Framework/TestListener.php';6require_once 'PHPUnit/Framework/TestFailure.php';7require_once 'PHPUnit/Framework/TestDecorator.php';8require_once 'PHPUnit/Framework/Warning.php';9require_once 'PHPUnit/Runner/Version.php';10require_once 'PHPUnit/Util/Filter.php';11require_once 'PHPUnit/Util/Printer.php';12require_once 'PHPUnit/Util/Getopt.php';13require_once 'PHPUnit/Util/Log/TeamCity.php';14require_once 'PHPUnit/Util/Log/JSON.php';15require_once 'PHPUnit/Util/Log/JUnit.php';16require_once 'PHPUnit/Util/Log/TestDox/Text.php';17require_once 'PHPUnit/Util/Log/TestDox/HTML.php';18require_once 'PHPUnit/Util/Log/TestDox/Xml.php';19require_once 'PHPUnit/Util/Log/TeamCity.php';20require_once 'PHPUnit/Util/Log/JSON.php';21require_once 'PHPUnit/Util/Log/JUnit.php';22require_once 'PHPUnit/Util/Log/TestDox/Text.php';
TestSuite
Using AI Code Generation
1use PHPUnit\Framework\TestSuite;2class TestSuite extends TestSuite {3 public static function suite() {4 $suite = new TestSuite('All tests');5 $suite->addTestFile('2.php');6 $suite->addTestFile('3.php');7 return $suite;8 }9}10use PHPUnit\Framework\TestCase;11class Test2 extends TestCase {12 public function test1() {13 $this->assertEquals(1, 1);14 }15}16use PHPUnit\Framework\TestCase;17class Test3 extends TestCase {18 public function test2() {19 $this->assertEquals(1, 1);20 }21}22E 1 / 1 (100%)
TestSuite
Using AI Code Generation
1require_once 'PHPUnit/Framework.php';2require_once 'PHPUnit/Extensions/PhptTestSuite.php';3require_once 'PHPUnit/Extensions/PhptTestCase.php';4require_once 'PHPUnit/Extensions/PhptTestCase/Parser.php';5require_once 'PHPUnit/Extensions/PhptTestCase/AssertionFailedError.php';6require_once 'PHPUnit/Extensions/PhptTestCase/Result.php';7require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser.php';8require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php.php';9require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser.php';10require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token.php';11require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream.php';12require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream/Filter.php';13require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream/Filter/RemoveComments.php';14require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream/Filter/RemoveWhitespace.php';15require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream/Filter/StripTags.php';16require_once 'PHPUnit/Extensions/PhptTestCase/Result/Parser/Php/Parser/Token/Stream/Filter/StripTags/Php.php';
TestSuite
Using AI Code Generation
1use PHPUnit\Framework\TestCase;2{3 public function testOne()4 {5 $this->assertTrue(true);6 }7}8use PHPUnit\Framework\TestCase;9{10 public function testOne()11 {12 $this->assertTrue(true);13 }14}15for i in 1.php 2.php; do vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox $i; done16for i in 1.php 2.php; do vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox $i; done
TestSuite
Using AI Code Generation
1use PHPUnit\Framework\TestSuite;2use Tests\Feature\ExampleTest;3$suite = new TestSuite('My Test Suite');4$suite->addTestSuite(ExampleTest::class);5$result = PHPUnit\TextUI\TestRunner::run($suite);6. 1 / 1 (100%)7OK (1 test, 1 assertion)
TestSuite
Using AI Code Generation
1use PHPUnit\Framework\TestSuite;2use PHPUnit\Framework\TestCase;3use App\ClassToBeTested;4{5 private $classToBeTested;6 protected function setUp()7 {8 $this->classToBeTested = new ClassToBeTested();9 }10 public function testMethodToBeTested()11 {12 $this->assertTrue($this->classToBeTested->methodToBeTested());13 }14 public function testMethodToBeTested2()15 {16 $this->assertFalse($this->classToBeTested->methodToBeTested());17 }18 public function testMethodToBeTested3()19 {20 $this->assertNull($this->classToBeTested->methodToBeTested());21 }22 public function testMethodToBeTested4()23 {24 $this->assertNotNull($this->classToBeTested->methodToBeTested());25 }26 public function testMethodToBeTested5()27 {28 $this->assertSame(true, $this->classToBeTested->methodToBeTested());29 }30 public function testMethodToBeTested6()31 {32 $this->assertNotSame(true, $this->classToBeTested->methodToBeTested());33 }34 public function testMethodToBeTested7()35 {36 $this->assertEquals(true, $this->classToBeTested->methodToBeTested());37 }
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!!