Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
[zendframework/zendframework#5570] CS and test fixes
Browse files Browse the repository at this point in the history
- Braces, whitespace.
- Incorrect variable references in tests caused them to fail; fixing them makes
  them pass.
  • Loading branch information
weierophinney committed Mar 3, 2014
1 parent 1a31a14 commit c485258
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Part.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getEncodedStream($EOL = Mime::LINEEND)
//stream_filter_remove(); // ??? is that right?
switch ($this->encoding) {
case Mime::ENCODING_QUOTEDPRINTABLE:
if(array_key_exists(Mime::ENCODING_QUOTEDPRINTABLE, $this->filters)) {
if (array_key_exists(Mime::ENCODING_QUOTEDPRINTABLE, $this->filters)) {
stream_filter_remove($this->filters[Mime::ENCODING_QUOTEDPRINTABLE]);
}
$filter = stream_filter_append(
Expand All @@ -98,7 +98,7 @@ public function getEncodedStream($EOL = Mime::LINEEND)
}
break;
case Mime::ENCODING_BASE64:
if(array_key_exists(Mime::ENCODING_BASE64,$this->filters)) {
if (array_key_exists(Mime::ENCODING_BASE64,$this->filters)) {
stream_filter_remove($this->filters[Mime::ENCODING_BASE64]);
}
$filter = stream_filter_append(
Expand Down Expand Up @@ -130,7 +130,7 @@ public function getContent($EOL = Mime::LINEEND)
{
if ($this->isStream) {
$encodedStream = $this->getEncodedStream($EOL);
$encodedStreamContents = stream_get_contents($encodedStream);
$encodedStreamContents = stream_get_contents($encodedStream);
rewind($encodedStream);
return $encodedStreamContents;
}
Expand Down
5 changes: 3 additions & 2 deletions test/PartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function testGetRawContentFromPart()

/**
* @link https://github.com/zendframework/zf2/issues/5428
* @group 5428
*/
public function testContentEncodingWithStreamReadTwiceINaRow()
{
Expand All @@ -117,15 +118,15 @@ public function testContentEncodingWithStreamReadTwiceINaRow()
$part->encoding = Mime\Mime::ENCODING_BASE64;
$contentEncodedFirstTime = $part->getContent();
$contentEncodedSecondTime = $part->getContent();
$this->assertEquals($contentFirstTime, $contentSecondTime);
$this->assertEquals($contentEncodedFirstTime, $contentEncodedSecondTime);
fclose($fp);

$fp = fopen($testfile,'rb');
$part = new Mime\Part($fp);
$part->encoding = Mime\Mime::ENCODING_QUOTEDPRINTABLE;
$contentEncodedFirstTime = $part->getContent();
$contentEncodedSecondTime = $part->getContent();
$this->assertEquals($contentFirstTime, $contentSecondTime);
$this->assertEquals($contentEncodedFirstTime, $contentEncodedSecondTime);
fclose($fp);
}
}

0 comments on commit c485258

Please sign in to comment.