示例#1
0
 protected function setUp()
 {
     $this->fs = new Filesystem();
     // real path /foo/
     $this->root_dir = sys_get_temp_dir() . '/tests/foo/bar/';
     $this->event_dir = sys_get_temp_dir() . '/tests/baz/';
     $this->fs->mkdir([$this->root_dir, $this->event_dir]);
     $this->monitor = tempnam(sys_get_temp_dir() . '/tests/', 'monitor');
     $this->zip = $this->getMock('\\ZipArchive');
     $this->listener = new UpdateItself($this->fs, $this->zip, $this->root_dir, $this->monitor);
     $this->event = $this->getMockBuilder('\\AnimeDb\\Bundle\\AnimeDbBundle\\Event\\UpdateItself\\Downloaded')->disableOriginalConstructor()->getMock();
     $this->event->expects($this->any())->method('getPath')->will($this->returnValue($this->event_dir));
 }