Exemplo n.º 1
0
 /**
  * @expectedException studio24\Rotate\RotateException
  */
 public function testInvalidSize()
 {
     $rotate = new Rotate('tests/test-files/orders.log');
     $rotate->size('10');
 }
Exemplo n.º 2
0
 public function testRotateSize()
 {
     $oldDir = getcwd();
     chdir($this->dir . '/size');
     $rotate = new Rotate('test-size-a.log');
     $rotate->size('25KB');
     $files = $rotate->run();
     $this->assertEmpty($files);
     $this->assertFalse(file_exists('test-size-a.log.1'));
     $rotate = new Rotate('test-size-b.log');
     $rotate->size('25KB');
     $rotate->run();
     $this->assertTrue(file_exists('test-size-b.log.1'));
     chdir($oldDir);
 }