1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
<?php
class Swift_Mime_EmbeddedFileTest extends Swift_Mime_AttachmentTest
{
public function testNestingLevelIsAttachment()
{
$this->markTestIncomplete('This test has not been implemented yet.',);
}
public function testNestingLevelIsEmbedded()
{
$file = $this->createEmbeddedFile($this->createHeaderSet(),
$this->createEncoder(), $this->createCache()
);
$this->assertEquals(
Swift_Mime_SimpleMimeEntity::LEVEL_RELATED, $file->getNestingLevel()
);
}
public function testIdIsAutoGenerated()
{
$headers = $this->createHeaderSet([], false);
$headers->shouldReceive('addIdHeader')
->once()
->with('Content-ID', \Mockery::pattern('/^.*?@.*?$/D'));
$file = $this->createEmbeddedFile($headers, $this->createEncoder(),
$this->createCache()
);
}
public function testDefaultDispositionIsInline()
{
$headers = $this->createHeaderSet([], false);
$headers->shouldReceive('addParameterizedHeader')
->once()
->with('Content-Disposition', 'inline');
$headers->shouldReceive('addParameterizedHeader')
->zeroOrMoreTimes();
$file = $this->createEmbeddedFile($headers, $this->createEncoder(),
$this->createCache()
);
}
protected function createAttachment($headers, $encoder, $cache, $mimeTypes = [])
{
return $this->createEmbeddedFile($headers, $encoder, $cache, $mimeTypes);
}
private function createEmbeddedFile($headers, $encoder, $cache)
{
$idGenerator = new Swift_Mime_IdGenerator('example.com');
return new Swift_Mime_EmbeddedFile($headers, $encoder, $cache, $idGenerator);
}
}
|