Esempio n. 1
0
 /** @covers Brickoo\Component\Common\Locker::count */
 public function testCount()
 {
     $this->lockerTestable->lock("name");
     $this->lockerTestable->lock("town");
     $this->lockerTestable->lock("country");
     $this->assertEquals(3, count($this->lockerTestable));
 }
Esempio n. 2
0
 /**
  * Class constructor.
  * @param array $registrations the registrations to add
  * @param boolean $readOnly initialize mode for the registry
  */
 public function __construct(array $registrations = [], $readOnly = false)
 {
     parent::__construct();
     $this->registrations = $registrations;
     $this->readOnly = !empty($registrations) && (bool) $readOnly;
 }