我正在尝试让 Phactory 与 Symfony2 项目一起工作。这是我在一个单元测试中的内容:
<?php
namespace VNN\PressboxBundle\Tests\Entity;
namespace VNN\PressboxBundle\Entity;
use VNN\PressboxBundle\Entity\User;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Phactory\Sql\Phactory;
class UserTest extends EntityTest
{
public function testCreate()
{
Phactory::define('user', array(
'username' => 'jasonswett',
));
}
}
当我尝试运行该测试时遇到的错误是:
PHP Fatal error: Class 'Phactory\Sql\Phactory' not found in /Users/jason/Web/pressbox/src/VNN/PressboxBundle/Tests/Entity/UserTest.php on line 12
很公平。如何让这个文件与 Phactory 对话?如果有帮助,我知道Phactory
该类已定义,vendor/chriskite/phactory/lib/Phactory/Sql/Phactory.php
并且它的前几行如下所示:
<?php
namespace Phactory\Sql;
class Phactory {