/** * @test */ public function canReset() { $data = ['one' => ['two' => ['a' => 111, 'b' => 222]]]; // can set and get a simple value $arrayAccessor = new ArrayAccessor($data); $this->assertSame(111, $arrayAccessor->get('one:two:a')); $this->assertSame(222, $arrayAccessor->get('one:two:b')); $arrayAccessor->reset('one:two:a'); $this->assertSame(null, $arrayAccessor->get('one:two:a')); $this->assertSame(222, $arrayAccessor->get('one:two:b')); }
/** * @test */ public function resetIsRemovingSubNodesAndEmptyNodes() { $data = ['one' => ['two' => ['a' => 111, 'b' => 222], 'three' => 333]]; // can set and get a simple value $arrayAccessor = new ArrayAccessor($data); $this->assertSame(111, $arrayAccessor->get('one:two:a')); $this->assertSame(222, $arrayAccessor->get('one:two:b')); $arrayAccessor->reset('one:two'); $this->assertSame(null, $arrayAccessor->get('one:two:a')); $this->assertSame(null, $arrayAccessor->get('one:two:b')); $this->assertSame(null, $arrayAccessor->get('one:two')); $this->assertSame(333, $arrayAccessor->get('one:three')); }
/** * @return array */ public function getAsArray() { return $this->argumentsAccessor->getData(); }
/** * Removes the pageSections filter setting. * * @return void */ public function removeSearchQueryFilterForPageSections() { $this->configurationAccess->reset('plugin.tx_solr.search.query.filter.__pageSections'); }