コード例 #1
0
 public function testChecksumWithClosure()
 {
     // closure must be serializable
     $sum = 'b87586a50f98a5bf404a8571e9db941d';
     $img = new ImageCache();
     $img->canvas(300, 200, 'fff');
     $img->text('foo', 0, 0, function ($font) {
         $font->valign('top');
         $font->size(32);
     });
     $this->assertEquals($img->checksum(), $sum);
     // checksum must differ, if values in closure change
     $sum = 'bdc29e647cfa9529a83a513a8e1e48f6';
     $img = new ImageCache();
     $img->canvas(300, 200, 'fff');
     $img->text('foo', 0, 0, function ($font) {
         $font->valign('top');
         $font->size(30);
     });
     $this->assertEquals($img->checksum(), $sum);
 }
コード例 #2
0
ファイル: ImageCacheTest.php プロジェクト: hungnt88/5stars-1
    public function testChecksumWithClosure()
    {
        // closure must be serializable
        $sum = 'e869cab5431815e67583b7c8cf3b657a';
        $img = new ImageCache;
        $img->canvas(300, 200, 'fff');
        $img->text('foo', 0, 0, function($font) {
            $font->valign('top');
            $font->size(32);
        });
        $this->assertEquals($img->checksum(), $sum);

        // checksum must differ, if values in closure change
        $sum = 'ec538f3194720c4657edde6af8145730';
        $img = new ImageCache;
        $img->canvas(300, 200, 'fff');
        $img->text('foo', 0, 0, function($font) {
            $font->valign('top');
            $font->size(30);
        });
        $this->assertEquals($img->checksum(), $sum);
    }
コード例 #3
0
 public function testChecksumWithClosure()
 {
     // closure must be serializable
     $sum = '96cb89799900f6655c75b2b3a671ca38';
     $img = new ImageCache();
     $img->canvas(300, 200, 'fff');
     $img->text('foo', 0, 0, function ($font) {
         $font->valign('top');
         $font->size(32);
     });
     $this->assertEquals($img->checksum(), $sum);
     // checksum must differ, if values in closure change
     $sum = '8ae197da869264c480c3093aa031fb20';
     $img = new ImageCache();
     $img->canvas(300, 200, 'fff');
     $img->text('foo', 0, 0, function ($font) {
         $font->valign('top');
         $font->size(30);
     });
     $this->assertEquals($img->checksum(), $sum);
 }