-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating to not json encode empty objects as [] unless you allow them.
- Loading branch information
Jacob Wyke
committed
Dec 7, 2015
1 parent
0bb97d6
commit 678e979
Showing
5 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Frozensheep\Synthesize\Tests\Type\Fixtures; | ||
|
||
use Frozensheep\Synthesize\Synthesizer; | ||
|
||
class EmptyObjectFixture implements \JsonSerializable { | ||
|
||
//include the Sythesizer trait | ||
use Synthesizer; | ||
|
||
//set the synthesized variables | ||
protected $arrSynthesize = array( | ||
'int' => array('type' => 'int'), | ||
'int1' => array('type' => 'int') | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Frozensheep\Synthesize\Tests\Type; | ||
|
||
use Frozensheep\Synthesize\Type\SynthesizeOption; | ||
|
||
class SynthesizeOptionTest extends \PHPUnit_Framework_TestCase { | ||
|
||
protected $objSynthesizeOption; | ||
|
||
protected function setUp(){ | ||
$this->objSynthesizeOption = new SynthesizeOption(); | ||
} | ||
|
||
public function testAllowedProperties(){ | ||
$arrProperties = array_flip($this->objSynthesizeOption->keys()); | ||
$this->assertArrayHasKey('type', $arrProperties); | ||
$this->assertArrayHasKey('default', $arrProperties); | ||
$this->assertArrayHasKey('min', $arrProperties); | ||
$this->assertArrayHasKey('max', $arrProperties); | ||
$this->assertArrayHasKey('format', $arrProperties); | ||
$this->assertArrayHasKey('class', $arrProperties); | ||
$this->assertArrayHasKey('json', $arrProperties); | ||
$this->assertArrayHasKey('jsonnull', $arrProperties); | ||
$this->assertArrayHasKey('autoinit', $arrProperties); | ||
|
||
$this->assertEquals(array('type','default','min','max','format','class','json','jsonnull','autoinit'), $this->objSynthesizeOption->keys()); | ||
} | ||
} |