Exemplo n.º 1
0
 /**
  * @covers Veles\Traits\Observable::notify
  * @depends testAttach
  */
 public function testNotify()
 {
     $obj = new ClassForTesting();
     $this->object->attach($obj);
     $this->object->notify();
     $msg = 'Wrong behavior of Observable::notify';
     $this->assertAttributeSame(true, 'flag', $obj, $msg);
 }
 /**
  * @covers       Veles\ErrorHandler\BaseErrorHandler::getTime
  * @dataProvider getTimeProvider
  * @depends      testSetTime
  *
  * @param $time
  * @param $expected
  */
 public function testGetTime($time, $expected)
 {
     $this->object->setTime($time);
     $msg = 'BaseErrorHandler::getTime() wrong behavior!';
     $result = $this->object->getTime();
     $this->assertGreaterThanOrEqual($expected, $result, $msg);
     $this->assertAttributeGreaterThanOrEqual($expected, 'time', $this->object, $msg);
     $expected = strftime('%Y-%m-%d %H:%M:%S', time());
     $this->assertLessThanOrEqual($expected, $result, $msg);
     $this->assertAttributeLessThanOrEqual($expected, 'time', $this->object, $msg);
 }