Пример #1
0
 public function testMergeSelf()
 {
     $generic = new Dictionary('string', 'string', ['foo' => 'bar']);
     $generic->merge(new Dictionary('string', 'string', ['baz' => 'foo']));
     $this->assertEquals(['foo' => 'bar', 'baz' => 'foo'], $generic->toArray());
 }
Пример #2
0
 public function testMergeArrayTwo()
 {
     $generic = new Dictionary('string', 'integer');
     $this->setExpectedException(InvalidTypeException::class, 'You cannot merge this array, since it contains incompatible types.');
     $generic->merge('this cannot work.');
 }