小编Wis*_*bes的帖子

symfony部署错误:映射的超类

当我在线部署包含映射的超类实体的symfony网站时,我收到以下错误:

AnnotationException: [Semantical Error] The annotation "@Doctrine\ORM\Mapping\MappedSuperClass" in class Acme\DemoBundle\Entity\Foo does not exist, or could not be auto-loaded.
Run Code Online (Sandbox Code Playgroud)

最糟糕的是,如果我们使用web/app.php(调试模式为true),则不会显示此错误,而如果您使用web/app_dev.php则会阻止该程序.

我应该补充一点,在本地,使用web/app.php或web/app_dev.php时不会显示此错误.

有没有人对这个黑暗的谜团有所了解?

提前感谢任何提示.

doctrine web-deployment mappedsuperclass symfony

6
推荐指数
1
解决办法
1022
查看次数

symfony2.4中的Behat 3(学说访问)

情况

我想从现在开始在我的symfony项目中使用BDD和Behat.目前的项目是sf2.4,我努力使Behat 3工作.我使用 了关于behat3的最新文档,正如jakub在这篇文章中所推荐的那样.

问题

Behat 3似乎运作良好.但是,为了能够真正启动,我需要访问内核(容器,学说等).我尝试使用my_project,测试项目再现了Behat的示例.但是,使用$ this-> container(),$ this-> kernel-> getContainer()总会引发"挂起异常"(代码在iShouldGet步骤停止):

public function iShouldGet(PyStringNode $string)
{
    //$container = $this->kernel->getContainer();
    //$container = $this->getContainer();
    //$doctrine = $this->getContainer()->get('doctrine');
    if ((string) $string !== $this->output) {
        throw new Exception(
            "Actual output is:\n" . $this->output
        );
    }
}
Run Code Online (Sandbox Code Playgroud)

我试图在AcmeDemoBundle中创建相同的behat'ls'测试:

|Acme 
    |Demo
        |Features
            |Context/FeatureContext.php
            ls.feature
Run Code Online (Sandbox Code Playgroud)

但是,它会引发错误:

[Behat\Testwork\Tester\Exception\WrongPathsException]    
No specifications found at path(s) `@AcmeDemoBundle`. 
Run Code Online (Sandbox Code Playgroud)

这可能是由于使用了Behat3,但我不确定.任何暗示为什么会出现这个问题/如何解决它?总的来说,非常感谢有关如何将behat与symfony2(2.4)项目集成的好建议.

非常感谢提前.

问候,


注意:这是我的文件:

behat.yml

# behat.yml
default:
  suites:
      my_suite:
          type: symfony_bundle
          bundle: AcmeDemoBundle
          mink_session: default
          mink_javascript_session: selenium2
  extensions: …
Run Code Online (Sandbox Code Playgroud)

symfony doctrine-orm behat

5
推荐指数
1
解决办法
3899
查看次数

symfony2中的behat&mink:@javascript标签问题

我在尝试在symfony项目中使用Behat和mink时面临一个问题(sf2.4).

情况:

我刚刚开始测试syhat for symfony2项目,看起来很棒.我也可以使用mink,因为我的主要项目目前是web项目.因此,我遵循官方文档的教程:官方文档

问题:

在使用selenium测试"在浏览器中"解决方案时,我下载jar,启动它,然后通过另一个cmd行窗口运行:

php bin/behat features/search.feature
Run Code Online (Sandbox Code Playgroud)

并出现错误:

 [Behat\Testwork\ServiceContainer\Exception\ProcessingException]           
 The @javascript tag cannot be used without enabling a javascript session 
Run Code Online (Sandbox Code Playgroud)

编辑:featureContext.php看起来像这样

<?php
#features/FeatureContext.php

use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;

use Behat\MinkExtension\Context\MinkContext;

/**
 * Behat context class.
*/
//class FeatureContext implements SnippetAcceptingContext
class FeatureContext extends MinkContext
{
    /**
     * Initializes context.
     *
     * Every scenario gets it's own context object.
     * You can also pass arbitrary arguments to the context constructor through behat.yml.
     */
    public function __construct() …
Run Code Online (Sandbox Code Playgroud)

javascript symfony behat mink

0
推荐指数
1
解决办法
2300
查看次数