Skip to content

Commit

Permalink
move blanko objecte to seperate namespace and test for "not supported…
Browse files Browse the repository at this point in the history
… object"
  • Loading branch information
ClemensSahs committed Sep 6, 2013
1 parent 91e72c3 commit f98e02b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/KlinaiTest/Client/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,34 @@ public function testStoreAttachmentByContentAsObjectWithoutContentType()

$this->storeAttachmentByContent($attachmentData, null );

$attachmentData = new \ObjectToArray (array(
$attachmentData = new TestAssert\ObjectToArray (array(
'class'=>'ObjectToArray',
));

$this->storeAttachmentByContent($attachmentData, null );

$attachmentData = new \ObjectToJson(array(
$attachmentData = new TestAssert\ObjectToJson(array(
'class'=>'ObjectToJson',
));

$this->storeAttachmentByContent($attachmentData, null );

$attachmentData = new \ObjectJson(array(
$attachmentData = new TestAssert\ObjectJson(array(
'class'=>'ObjectJson',
));

$this->storeAttachmentByContent($attachmentData, null );
}

public function testStoreAttachmentByNotSupportedObjectWithoutContentType()
{
$attachmentData = new TestAssert\ObjectNotSupportedJson(array(
'class'=>'ObjectNotSupportedJson',
));

$this->storeAttachmentByContent($attachmentData, null );
}

protected function storeAttachmentByContent($data,$type=null)
{
$attachmentId = 'attachment1';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace KlinaiTest\Client\TestAsset;

class ObjectJson implements \JsonSerializable {
protected $data;

Expand Down
8 changes: 8 additions & 0 deletions tests/KlinaiTest/Client/TestAsset/ObjectNotSupported.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace KlinaiTest\Client\TestAsset;

class ObjectNotSupported {
public function __construct() {
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace KlinaiTest\Client\TestAsset;

class ObjectToArray {
protected $data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace KlinaiTest\Client\TestAsset;

class ObjectToJson {
protected $data;

Expand Down

0 comments on commit f98e02b

Please sign in to comment.