Exemplo n.º 1
0
 /**
  * @test
  */
 public function addedProfileShouldBeReturned()
 {
     $filelib = new FileLibrary($this->getMockedStorageAdapter(), $this->getMockedBackendAdapter());
     $this->assertCount(1, $filelib->getProfiles());
     try {
         $profile = $filelib->getProfile('tussi');
         $this->fail('should have thrown exception');
     } catch (\InvalidArgumentException $e) {
         $p = new FileProfile('tussi', $this->getMockedLinker());
         $filelib->addProfile($p);
         $this->assertSame($p, $filelib->getProfile('tussi'));
         $this->assertCount(2, $filelib->getProfiles());
     }
 }
Exemplo n.º 2
0
 private function getFilelib($mockedEventDispatcher)
 {
     $filelib = new FileLibrary(new MemoryStorageAdapter(), new MemoryBackendAdapter(), $mockedEventDispatcher ? $this->ed->reveal() : new EventDispatcher());
     $filelib->addProfile(new FileProfile('tussi', false));
     return $filelib;
 }