public function ServicesResourceFileTests::testResourceFileCreateRaw in Services 7.3
Test create_raw method.
File
- tests/
functional/ ServicesResourceFileTests.test, line 122 - Test for file resource.
Class
- ServicesResourceFileTests
- Test class.
Code
public function testResourceFileCreateRaw() {
// Create file with call.
$result = $this
->servicesPostFile($this->endpoint->path . '/file/create_raw', $this->testfile->uri);
$this
->assertEqual($result['code'], 200, 'File created.', 'FileResource: Create');
// Load file and assert that it exists.
$file_load = file_load($result['body'][0]['fid']);
$this
->assertTrue(is_file($file_load->uri), 'New file saved to disk.', 'FileResource: Create');
}