/** * Prepare the class array with the buildClasses */ private function setBuildClasses() { if ($this->isBuild === true) { return; } if (count($this->getClasses()) === 0) { throw new \Exception('No classes defined, please call setCLasses()'); } $this->buildClasses = []; foreach ($this->getOrdererClasses() as $class) { $build = new BuildClass(); $build->setClass($class); if ($build->canBeCached() === true) { $this->buildClasses[$class->getName()] = $build; } } $this->isBuild = true; }
/** * @covers SpeedLoader\BuildClass::getResult */ public function testGetResult() { $classRef = new ClassReflection('SpeedLoaderTestAsset\\Simple\\ClassWithBody'); $buildClass = new BuildClass(); $buildClass->setClass($classRef); $buildClass->setCompressionLevel(BuildClass::COMPRESS_NONE); $result = $this->invokeMethod($buildClass, 'getResult'); $expected = 'namespace SpeedLoaderTestAsset\\Simple { class ClassWithBody { public function test(){} } }'; $this->assertEquals($expected, $result); }