Ejemplo n.º 1
0
 /**
  * Inserts a cassette to record responses and requests on.
  *
  * @api
  *
  * @param string $cassetteName Name of the cassette (used for the cassette filename).
  *
  * @return void
  * @throws VCRException If videorecorder is turned off when inserting a cassette.
  */
 public function insertCassette($cassetteName)
 {
     Assertion::true($this->isOn, 'Please turn on VCR before inserting a cassette, use: VCR::turnOn().');
     if (!is_null($this->cassette)) {
         $this->eject();
     }
     $storage = $this->factory->get('Storage', array($cassetteName));
     $this->cassette = new Cassette($cassetteName, $this->config, $storage);
     $this->enableLibraryHooks();
 }