forFeature() public method

Create a new Builder instance.
See also: Zumba\Swivel\ManagerInterface
public forFeature ( string $slug ) : Builder
$slug string
return Builder
Example #1
0
 public function testForFeature()
 {
     $manager = new Manager(new Config());
     $map = $this->getMock('Zumba\\Swivel\\Map');
     $bucket = $this->getMock('Zumba\\Swivel\\Bucket', null, [$map]);
     $manager->setBucket($bucket);
     $this->assertInstanceOf('Zumba\\Swivel\\Builder', $manager->forFeature('Test'));
 }
Example #2
0
 public function testNoDefaultFeatureOff()
 {
     $swivel = new Manager(new Config($this->map, 8));
     $result = $swivel->forFeature('System')->addBehavior('NewAlgorithm', function () {
         return 'NewHotness';
     })->noDefault()->execute();
     $this->assertSame(null, $result);
 }
Example #3
0
 /**
  * Create a new Builder instance
  *
  * @param string $slug
  * @return \Zumba\Swivel\Builder
  * @see \Zumba\Swivel\ManagerInterface
  */
 public function forFeature($slug)
 {
     $feature = parent::forFeature($slug);
     $this->features[$slug] = $feature;
     return $feature;
 }