WC_Mock_WC_Data::get_content PHP 메소드

get_content() 공개 메소드

Simple get content.
public get_content ( string $context = 'view' ) : string
$context string
리턴 string
    public function get_content($context = 'view')
    {
        return $this->get_prop('content', $context);
    }

Usage Example

예제 #1
0
 /**
  * Test: set_props
  */
 function test_set_props()
 {
     $object = new WC_Mock_WC_Data();
     $data_to_set = array('content' => 'I am a fish', 'bool_value' => true);
     $result = $object->set_props($data_to_set);
     $this->assertFalse(is_wp_error($result));
     $this->assertEquals('I am a fish', $object->get_content());
     $this->assertEquals(true, $object->get_bool_value());
     $data_to_set = array('content' => 'I am also a fish', 'bool_value' => 'thisisinvalid');
     $result = $object->set_props($data_to_set);
     $this->assertTrue(is_wp_error($result));
     $this->assertEquals('I am also a fish', $object->get_content());
     $this->assertNotEquals('thisisinvalid', $object->get_bool_value());
 }