public function ClientTest::testBodyIsBelowLimit in Akamai 7.3
Tests the bodyIsBelowLimit method.
@covers Drupal\akamai\Ccu3Client::bodyIsBelowLimit
File
- tests/
Ccu3ClientTest.php, line 140 - Unit tests for the Drupal\akamai\Ccu3Client class.
Class
Namespace
Drupal\akamai\TestsCode
public function testBodyIsBelowLimit() {
// Create stub for the EdgeGrid client class.
$edgegrid_client = $this
->getMockBuilder('\\Akamai\\Open\\EdgeGrid\\Client')
->disableOriginalConstructor()
->setMethods([
'post',
])
->getMock();
$ccu_client = new Ccu3Client($edgegrid_client);
$hostname = 'www.example.com';
$paths = [
'/a',
];
$this
->assertTrue($ccu_client
->bodyIsBelowLimit($hostname, $paths), 'Body size is not below limit.');
for ($i = 0; $i < 15000; $i++) {
$paths[] = '/a' . $i;
}
$this
->assertFalse($ccu_client
->bodyIsBelowLimit($hostname, $paths), 'Expected body size to exceed limit.');
}