/** * Test that the Stapler class can build a single instance of * the Interpolator class. * * @test * @return void */ public function it_should_be_able_to_create_a_singleton_interpolator_instance() { $interpolator1 = Stapler::getInterpolatorInstance(); $interpolator2 = Stapler::getInterpolatorInstance(); $this->assertInstanceOf('Codesleeve\\Stapler\\Interpolator', $interpolator1); $this->assertSame($interpolator1, $interpolator2); }
/** * Build out the dependencies required to create * a new attachment object. * * @param string $name * @param array $options * * @return array */ protected static function buildDependencies($name, array $options) { return [new AttachmentConfig($name, $options), Stapler::getInterpolatorInstance(), Stapler::getResizerInstance($options['image_processing_library'])]; }