2017-06-18 106 views
0

我试图使用本地,基于作曲者的TYPO3 8.7安装来运行我的一些扩展的单元测试。这是我的作曲文件:使用TYPO3测试框架运行单元测试的各种错误

{ 
    "repositories": [ 
    { "type": "vcs", "url": "https://git.typo3.org/Packages/TYPO3.CMS.git" }, 
    { "type": "vcs", "url": "https://github.com/cobwebch/external_import.git"}, 
    { "type": "vcs", "url": "https://github.com/fsuter/externalimport_test.git"}, 
    { "type": "vcs", "url": "https://github.com/cobwebch/svconnector.git"}, 
    { "type": "vcs", "url": "https://github.com/cobwebch/svconnector_csv.git"}, 
    { "type": "vcs", "url": "https://github.com/cobwebch/svconnector_feed.git"}, 
    { "type": "vcs", "url": "https://github.com/cobwebch/svconnector_json.git"}, 
    { "type": "vcs", "url": "https://github.com/cobwebch/svconnector_sql.git"} 
    ], 
    "name": "my-vendor/my-typo3-cms-distribution", 
    "require": { 
    "typo3/cms": "TYPO3_8-7-dev", 
    "cobweb/external_import": "dev-wombat", 
    "cobweb/externalimport_test": "dev-master", 
    "cobweb/svconnector": "dev-master", 
    "cobweb/svconnector_csv": "dev-master", 
    "cobweb/svconnector_feed": "dev-master", 
    "cobweb/svconnector_json": "dev-master", 
    "cobweb/svconnector_sql": "dev-master" 
    }, 
    "extra": { 
    "typo3/cms": { 
     "cms-package-dir": "{$vendor-dir}/typo3/cms", 
     "web-dir": "web" 
    } 
    }, 
    "require-dev": { 
    "nimut/testing-framework": "^1.1" 
    } 
} 

我完全不明白这TYPO3的部分在引导过程中,同时运行在命令行的单元测试初始化​​,但似乎不完整的。

个例子:当我试图运行扩展名为“svconnector_csv”使用单元测试(在“网络”文件夹中):

/path/to/php ../vendor/bin/phpunit -c ../vendor/nimut/testing-framework/res/Configuration/UnitTests.xml typo3conf/ext/svconnector_csv/Tests/Unit/ 

所有测试失败,报告异常,没有服务密钥“tx_svconnectorcsv_sv1 “ 可以被找寻到。在后端检入时使用该服务安装正确(使用报告模块)。

使用类似命令运行扩展名为“external_import”的测试时出现另一个错误,但也是一个问题。我收到错误,指出TCA未加载。

能否以任何方式影响所处理的引导,以确保像TCA和T3_SERVICES这样的全局数组被加载?或者他们应该和我错过了我的设置中的东西?

作为参考,这里的链接到两个扩展的源代码:

+0

难道是测试框架有自己的安装没有安装该服务? – hakre

回答

0

我用这个测试的框架,太。我用它在GitLab CI与运行我的分机:

.Build/bin/phpunit -c Configuration/.Build/Tests/UnitTests.xml 

我UnitTests.xml:

<phpunit 
    backupGlobals="true" 
    backupStaticAttributes="false" 
    bootstrap="../../../.Build/vendor/nimut/testing-framework/src/TestingFramework/Bootstrap/UnitTestsBootstrap.php" 
    colors="true" 
    convertErrorsToExceptions="true" 
    convertWarningsToExceptions="true" 
    forceCoversAnnotation="false" 
    processIsolation="false" 
    stopOnError="false" 
    stopOnFailure="false" 
    stopOnIncomplete="false" 
    stopOnSkipped="false" 
    verbose="false" 
> 
    <testsuites> 
     <testsuite name="Base tests"> 
      <directory>../../../Tests/Unit</directory> 
     </testsuite> 
    </testsuites> 
</phpunit> 

希望,它帮助。

+0

同样的结果,但无论如何感谢。 –

相关问题