public function testIt()
 {
     $foo = new Scope('foo');
     $bar = new Scope('bar');
     $this->assertNull($this->repository->find('foo'));
     $this->assertNull($this->repository->find('bar'));
     $this->repository->add($foo);
     $this->assertEquals($foo, $this->repository->find('foo'));
     $this->assertNull($this->repository->find('bar'));
     $this->repository->add($bar);
     $this->assertEquals($foo, $this->repository->find('foo'));
     $this->assertEquals($bar, $this->repository->find('bar'));
 }
Esempio n. 2
0
 /**
  * @Given /^there are scopes:$/
  */
 public function thereAreScopes(TableNode $table)
 {
     foreach ($table->getRows() as $row) {
         $this->scopeRepository->add(new Scope($row[0]));
     }
 }