Example #1
0
 /**
  * @expectedException \Giftcards\Encryption\Factory\BuilderNotFoundException
  */
 public function testGetWithMissingBuilder()
 {
     $builder1Name = $this->getFaker()->unique()->word;
     $builder1 = \Mockery::mock('Giftcards\\Encryption\\Factory\\BuilderInterface')->shouldReceive('getName')->andReturn($builder1Name)->getMock();
     $builder2Name = $this->getFaker()->unique()->word;
     $builder2 = \Mockery::mock('Giftcards\\Encryption\\Factory\\BuilderInterface')->shouldReceive('getName')->andReturn($builder2Name)->getMock();
     $this->assertSame($this->registry, $this->registry->add($builder1));
     $this->assertSame($this->registry, $this->registry->add($builder2));
     $this->assertSame($builder1, $this->registry->get($builder1Name));
     $this->registry->get($this->getFaker()->unique()->word);
 }
 public function all()
 {
     foreach ($this->builders as $name => $cipher) {
         $this->load($name);
     }
     return parent::all();
 }