9 use AspectMock\Test as AspectMock;
25 "selector" =>
"#element" 34 "selector" =>
"#element" 40 $this->setMockParserOutput($mockData);
44 $sections = $sectionHandler->getAllObjects();
45 $section = $sectionHandler->getObject(
"testSection1");
46 $invalidSection = $sectionHandler->getObject(
"InvalidSection");
49 $this->assertCount(2, $sections);
50 $this->assertArrayHasKey(
"testSection1", $sections);
51 $this->assertArrayHasKey(
"testSection2", $sections);
52 $this->assertNull($invalidSection);
60 private function setMockParserOutput(
$data)
63 $property = new \ReflectionProperty(SectionObjectHandler::class,
"INSTANCE");
64 $property->setAccessible(
true);
65 $property->setValue(
null);
67 $mockSectionParser = AspectMock::double(SectionParser::class, [
"getData" =>
$data])->make();
68 $instance = AspectMock::double(ObjectManager::class, [
"get" => $mockSectionParser])->make();
69 AspectMock::double(ObjectManagerFactory::class, [
"getObjectManager" => $instance]);