我在我的模塊中的一個有一個測試文件夾中,以3子文件夾:PHPUnit的不加載一些測試
Model
Helper
Integration
運行
phpunit --group My_Module
僅執行模式和輔助測試目錄,集成文件夾保持不變。測試文件直接存在於所有情況下的文件夾中,所以我不確定是什麼導致了這個問題。 這裏是我的phpunit.xml:
<?xml version="1.0"?>
<!-- initial phpunit configuration file, that you can modify for your project needs -->
<phpunit cacheTokens="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
strict="false"
verbose="false"
bootstrap="app/code/community/EcomDev/PHPUnit/bootstrap.php">
<listeners>
<listener file="app/code/community/EcomDev/PHPUnit/Test/Listener.php" class="EcomDev_PHPUnit_Test_Listener" />
</listeners>
<testsuites>
<testsuite name="MyApp">
<directory suffix=".php">app/code/local/*/*/Test/*/</directory>
</testsuite>
<testsuite name="Magento Test Suite">
<file>app/code/community/EcomDev/PHPUnit/Test/Suite.php</file>
</testsuite>
</testsuites>
<filter>
<blacklist>
<!-- Exclude Magento Core files from code coverage -->
<directory suffix=".php">app/code/core</directory>
<!-- Exclude EcomDev_PHPUnit classes from code coverage -->
<directory suffix=".php">app/code/community/EcomDev/PHPUnit</directory>
<directory suffix=".php">lib/EcomDev/Utils</directory>
<directory suffix=".php">lib/EcomDev/PHPUnit</directory>
<directory suffix=".php">lib/Spyc</directory>
<directory suffix=".php">lib/vfsStream</directory>
<!-- Exclude Mage.php file from code coverage -->
<file>app/Mage.php</file>
<!-- Exclude template files -->
<directory suffix=".phtml">app/design</directory>
<!-- Exclude Varien & Zend libraries -->
<directory suffix=".php">lib/Varien</directory>
<directory suffix=".php">lib/Zend</directory>
</blacklist>
</filter>
<logging>
<!-- Uncomment this line if you want to have coverage report generated every test run
<log type="coverage-html" target="var/phpunit/coverage" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="var/phpunit/coverage.xml"/>
-->
<log type="junit" target="../build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>
的PHPUnit的版本,我的Ubuntu上運行虛擬機是28年7月3日。我怎樣才能讓所有的測試運行?幫助將不勝感激。
您是否已將「集成」中的測試添加到My_Module組? – SenseException
是的,我做到了。奇怪的是,模型和助手中的測試也有組標記,因此不確定兩個文件夾之間有什麼不同。 –
如果您將「集成」重命名爲「控制器」或符合Magento-Structure的其他名稱,它會保持嗎? – LeMike