You are here

public function MediaInternetTestHandler::getFileObject in D7 Media 7.4

Same name and namespace in other branches
  1. 7.2 modules/media_internet/tests/includes/MediaInternetTestHandler.inc \MediaInternetTestHandler::getFileObject()
  2. 7.3 modules/media_internet/tests/includes/MediaInternetTestHandler.inc \MediaInternetTestHandler::getFileObject()

Returns a file object which can be used for validation.

Return value

StdClass

Overrides MediaInternetBaseHandler::getFileObject

File

modules/media_internet/tests/includes/MediaInternetTestHandler.inc, line 34
Extends the MediaInternetBaseHandler class to handle videos from an imaginary example.com.

Class

MediaInternetTestHandler
Implementation of MediaInternetBaseHandler.

Code

public function getFileObject() {
  $uri = $this
    ->parse($this->embedCode);
  $file = file_uri_to_object($uri, TRUE);

  // Override the default filename for testing purposes.
  if (empty($file->fid)) {
    $file->filename = 'Drupal';
  }
  return $file;
}