updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions

View File

@@ -26,13 +26,13 @@ class AutoExpireFlashBagTest extends TestCase
*/
private $bag;
protected $array = array();
protected $array = [];
protected function setUp()
{
parent::setUp();
$this->bag = new FlashBag();
$this->array = array('new' => array('notice' => array('A previous flash message')));
$this->array = ['new' => ['notice' => ['A previous flash message']]];
$this->bag->initialize($this->array);
}
@@ -45,16 +45,16 @@ class AutoExpireFlashBagTest extends TestCase
public function testInitialize()
{
$bag = new FlashBag();
$array = array('new' => array('notice' => array('A previous flash message')));
$array = ['new' => ['notice' => ['A previous flash message']]];
$bag->initialize($array);
$this->assertEquals(array('A previous flash message'), $bag->peek('notice'));
$array = array('new' => array(
'notice' => array('Something else'),
'error' => array('a'),
));
$this->assertEquals(['A previous flash message'], $bag->peek('notice'));
$array = ['new' => [
'notice' => ['Something else'],
'error' => ['a'],
]];
$bag->initialize($array);
$this->assertEquals(array('Something else'), $bag->peek('notice'));
$this->assertEquals(array('a'), $bag->peek('error'));
$this->assertEquals(['Something else'], $bag->peek('notice'));
$this->assertEquals(['a'], $bag->peek('error'));
}
public function testGetStorageKey()
@@ -73,16 +73,16 @@ class AutoExpireFlashBagTest extends TestCase
public function testPeek()
{
$this->assertEquals(array(), $this->bag->peek('non_existing'));
$this->assertEquals(array('default'), $this->bag->peek('non_existing', array('default')));
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
$this->assertEquals([], $this->bag->peek('non_existing'));
$this->assertEquals(['default'], $this->bag->peek('non_existing', ['default']));
$this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
$this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
}
public function testSet()
{
$this->bag->set('notice', 'Foo');
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
$this->assertEquals(['A previous flash message'], $this->bag->peek('notice'));
}
public function testHas()
@@ -93,43 +93,43 @@ class AutoExpireFlashBagTest extends TestCase
public function testKeys()
{
$this->assertEquals(array('notice'), $this->bag->keys());
$this->assertEquals(['notice'], $this->bag->keys());
}
public function testPeekAll()
{
$array = array(
'new' => array(
$array = [
'new' => [
'notice' => 'Foo',
'error' => 'Bar',
),
);
],
];
$this->bag->initialize($array);
$this->assertEquals(array(
$this->assertEquals([
'notice' => 'Foo',
'error' => 'Bar',
), $this->bag->peekAll()
], $this->bag->peekAll()
);
$this->assertEquals(array(
$this->assertEquals([
'notice' => 'Foo',
'error' => 'Bar',
), $this->bag->peekAll()
], $this->bag->peekAll()
);
}
public function testGet()
{
$this->assertEquals(array(), $this->bag->get('non_existing'));
$this->assertEquals(array('default'), $this->bag->get('non_existing', array('default')));
$this->assertEquals(array('A previous flash message'), $this->bag->get('notice'));
$this->assertEquals(array(), $this->bag->get('notice'));
$this->assertEquals([], $this->bag->get('non_existing'));
$this->assertEquals(['default'], $this->bag->get('non_existing', ['default']));
$this->assertEquals(['A previous flash message'], $this->bag->get('notice'));
$this->assertEquals([], $this->bag->get('notice'));
}
public function testSetAll()
{
$this->bag->setAll(array('a' => 'first', 'b' => 'second'));
$this->bag->setAll(['a' => 'first', 'b' => 'second']);
$this->assertFalse($this->bag->has('a'));
$this->assertFalse($this->bag->has('b'));
}
@@ -138,17 +138,17 @@ class AutoExpireFlashBagTest extends TestCase
{
$this->bag->set('notice', 'Foo');
$this->bag->set('error', 'Bar');
$this->assertEquals(array(
'notice' => array('A previous flash message'),
), $this->bag->all()
$this->assertEquals([
'notice' => ['A previous flash message'],
], $this->bag->all()
);
$this->assertEquals(array(), $this->bag->all());
$this->assertEquals([], $this->bag->all());
}
public function testClear()
{
$this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear());
$this->assertEquals(['notice' => ['A previous flash message']], $this->bag->clear());
}
public function testDoNotRemoveTheNewFlashesWhenDisplayingTheExistingOnes()
@@ -156,6 +156,6 @@ class AutoExpireFlashBagTest extends TestCase
$this->bag->add('success', 'Something');
$this->bag->all();
$this->assertEquals(array('new' => array('success' => array('Something')), 'display' => array()), $this->array);
$this->assertEquals(['new' => ['success' => ['Something']], 'display' => []], $this->array);
}
}