コード例 #1
0
ファイル: IsValidTest.php プロジェクト: fezfez/keep-update
 public function testClassValidWithoutAnnotationAndSyncAndJsonSerializableWithRealInstance()
 {
     $sUT = ArrayValidatorFactory::getInstance();
     $data = array('test' => 'im in !');
     $this->setExpectedException('KeepUpdate\\ValidationException');
     $sUT->isValid(new WithoutJsonSerializableAndAnnotation(), $data);
 }
コード例 #2
0
 public function testFail()
 {
     $sUT = ArrayValidatorFactory::getInstance();
     $data = array('testmyself' => "im not sync :'(");
     $this->setExpectedException('KeepUpdate\\SynchronisationException');
     $sUT->isValid('KeepUpdate\\Tests\\Sample\\SynchronizerFail', $data);
 }
コード例 #3
0
ファイル: ChainTest.php プロジェクト: fezfez/keep-update
 public function testValidWithNullableChain()
 {
     $sUT = ArrayValidatorFactory::getInstance();
     $result = array('test' => array('test' => 'chain !'));
     $this->assertEquals($result, $sUT->isValid('KeepUpdate\\Tests\\Sample\\ChainNullable', $result));
     $result = array('test' => null);
     $this->assertEquals($result, $sUT->isValid('KeepUpdate\\Tests\\Sample\\ChainNullable', $result));
 }
コード例 #4
0
 public function testInstance()
 {
     $this->assertInstanceOf('KeepUpdate\\ArrayValidator', ArrayValidatorFactory::getInstance());
 }
コード例 #5
0
ファイル: CamelCaseTest.php プロジェクト: fezfez/keep-update
 public function testClassFailWithChainIsNotAnArray()
 {
     $sUT = ArrayValidatorFactory::getInstance();
     $data = array('test_camel_case' => 'im a camel case chain !');
     $this->assertEquals($data, $sUT->isValid('KeepUpdate\\Tests\\Sample\\CamelCase', $data));
 }
コード例 #6
0
 public function testValidWithIsInstanceOfNullable()
 {
     $sUT = ArrayValidatorFactory::getInstance();
     $data = array('test' => null);
     $this->assertEquals($data, $sUT->isValid('KeepUpdate\\Tests\\Sample\\PlainTextClassImplementsNullable', $data));
 }