PHPUnit测试中容器的Symfony内存问题
我有以下测试。这导致PHPUnit测试中容器的Symfony内存问题,php,phpunit,php-7.2,symfony-4.3,Php,Phpunit,Php 7.2,Symfony 4.3,我有以下测试。这导致PHP致命错误:内存不足(已分配704905216)(试图分配139802474386369字节)error 这里的$this->client->getContainer()似乎是问题的根源。但我不知道该怎么写。如何解决这个内存问题 public function testIndexWithCreateUser() { $printMock = $this->createMock(InternPrintApi::class); $
PHP致命错误:内存不足(已分配704905216)(试图分配139802474386369字节)
error
这里的$this->client->getContainer()
似乎是问题的根源。但我不知道该怎么写。如何解决这个内存问题
public function testIndexWithCreateUser()
{
$printMock = $this->createMock(InternPrintApi::class);
$printMock->expects($this->once())
->method('createUser')
->willReturn(json_decode('{"user":{"account":{"email":"test.user@example.com"}}}'));
$this->client->getContainer()->set(InternPrintApi::class, $printMock);
$this->client->request('POST', '/registration', [
'registration' => [
'email' => 'test.user@example.com',
'password' => 'password'
]
]);
$this->assertEquals(302, $this->client->getResponse()->getStatusCode());
}