TestTimberImage::testReplacedImage PHP Method

testReplacedImage() public method

* ---------------- Tests ----------------
public testReplacedImage ( )
    function testReplacedImage()
    {
        $pid = $this->factory->post->create(array('post_type' => 'post'));
        $attach_id = self::get_image_attachment($pid, 'arch.jpg');
        $template = '{{Image(img).src|resize(200, 200)}}';
        $str = Timber::compile_string($template, array('img' => $attach_id));
        $resized_one = Timber\ImageHelper::get_server_location($str);
        sleep(5);
        $filename = self::copyTestImage('cardinals.jpg', 'arch.jpg');
        $str = Timber::compile_string($template, array('img' => $attach_id));
        $resized_tester = Timber\ImageHelper::get_server_location($str);
        $attach_id = self::get_image_attachment($pid, 'cardinals.jpg');
        $str = Timber::compile_string($template, array('img' => $attach_id));
        $resized_known = Timber\ImageHelper::get_server_location($str);
        //resize original, compare
        $this->assertEquals(md5(file_get_contents($resized_known)), md5(file_get_contents($resized_tester)));
    }