14 $this->assertStringEndsWith(PHP_EOL,
$result);
20 $result = $object->printStats();
21 $this->assertContains(
'Memory usage (OS):',
$result);
22 $this->assertContains(
'1.00M',
$result);
23 $this->assertContains(
'Estimated memory leak:',
$result);
24 $this->assertContains(
'reported by PHP',
$result);
25 $this->assertStringEndsWith(PHP_EOL,
$result);
28 $this->assertContains(
'50.00% of configured 2.00M limit', $object->printStats());
31 $this->assertContains(
'% of configured 0.49M limit', $object->printStats());
37 $this->assertNull($object->validateUsage());
46 $object->validateUsage();
56 $helper = $this->createPartialMock(\
Magento\TestFramework\Helper\Memory::class, [
'getRealMemoryUsage']);
57 $helper->expects($this->any())->method(
'getRealMemoryUsage')->will($this->returnValue(1024 * 1024));
58 return new \Magento\TestFramework\MemoryLimit($memCap, $leakCap,
$helper);
_createObject($memCap, $leakCap)
testValidateUsageException()