Exemple #1
0
 /**
  * @test
  */
 public function shouldReturnTrueIfRequiredFieldsSet()
 {
     $arrayObject = new ArrayObject();
     $arrayObject['aRequiredField'] = 'foo';
     $arrayObject['otherRequiredField'] = 'bar';
     $this->assertTrue($arrayObject->validatedKeysSet(array('aRequiredField', 'otherRequiredField')));
 }
Exemple #2
0
 /**
  * This simply returns NULL when an array does not have this index.
  * It allows us not to do isset all the time we want to access something.
  *
  * {@inheritdoc}
  */
 public function offsetGet($index)
 {
     if ($this->offsetExists($index)) {
         return parent::offsetGet($index);
     }
     return null;
 }