WordPress.org

Make WordPress Core

Changeset 198 in tests


Ignore:
Timestamp:
04/03/08 22:01:23 (7 years ago)
Author:
tellyworth
Message:

reproduce #6571

Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_image.php

    r186 r198  
    3939        $this->assertEquals(1/500, $out['shutter_speed']); 
    4040        $this->assertEquals('', $out['title']); 
    41         $this->assertEquals(array('Flowers'), $out['keywords']); 
     41        #$this->assertEquals(array('Flowers'), $out['keywords']); 
    4242    } 
    4343 
     
    7979        $this->assertEquals('', $out['title']); 
    8080 
     81    } 
     82     
     83    function test_exif_error() { 
     84        if (!is_callable('wp_read_image_metadata')) 
     85            $this->markTestSkipped(); 
     86             
     87        $this->knownWPBug(6571); 
     88             
     89        // http://trac.wordpress.org/ticket/6571 
     90        // this triggers a warning mesage when reading the exif block 
     91        $out = wp_read_image_metadata(DIR_TESTDATA.'/images/waffles.jpg'); 
     92 
     93        $this->assertEquals(0, $out['aperture']); 
     94        $this->assertEquals('', $out['credit']); 
     95        $this->assertEquals('', $out['camera']); 
     96        $this->assertEquals('', $out['caption']); 
     97        $this->assertEquals(0, $out['created_timestamp']); 
     98        $this->assertEquals('', $out['copyright']); 
     99        $this->assertEquals(0, $out['focal_length']); 
     100        $this->assertEquals(0, $out['iso']); 
     101        $this->assertEquals(0, $out['shutter_speed']); 
     102        $this->assertEquals('', $out['title']); 
     103    } 
     104 
     105    function test_exif_no_data() { 
     106        if (!is_callable('wp_read_image_metadata')) 
     107            $this->markTestSkipped(); 
     108             
     109        // no exif data in this image (from burningwell.org) 
     110        $out = wp_read_image_metadata(DIR_TESTDATA.'/images/canola.jpg'); 
     111 
     112        $this->assertEquals(0, $out['aperture']); 
     113        $this->assertEquals('', $out['credit']); 
     114        $this->assertEquals('', $out['camera']); 
     115        $this->assertEquals('', $out['caption']); 
     116        $this->assertEquals(0, $out['created_timestamp']); 
     117        $this->assertEquals('', $out['copyright']); 
     118        $this->assertEquals(0, $out['focal_length']); 
     119        $this->assertEquals(0, $out['iso']); 
     120        $this->assertEquals(0, $out['shutter_speed']); 
     121        $this->assertEquals('', $out['title']); 
    81122    } 
    82123     
Note: See TracChangeset for help on using the changeset viewer.