Beispiel #1
0
 public function tearDown()
 {
     unset($this->app);
     PHPUnit_Framework_Error_Warning::$enabled = $this->warning_enabled;
     PHPUnit_Framework_Error_Notice::$enabled = $this->notice_enabled;
     PHPUnit_Framework_Error_Deprecated::$enabled = $this->deprecated_enabled;
 }
 public function testTemplateOption()
 {
     \PHPUnit_Framework_Error_Deprecated::$enabled = false;
     $processor = new Processor();
     $config = @$processor->processConfiguration(new Configuration(), array('fsi_data_grid' => array('twig' => array('template' => 'custom_datagrid.html.twig'))));
     $this->assertSame($config, array('twig' => array('enabled' => true, 'themes' => array('custom_datagrid.html.twig')), 'yaml_configuration' => true));
 }
Beispiel #3
0
 /**
  * testZipCodeCountryMethod
  *
  * @param mixed  $code
  * @param string $country
  * @param bool   $result
  *
  * @dataProvider zipCodes
  *
  * @return void
  */
 public function testZipCodeCountryMethod($code, $country, $result)
 {
     $enabled = \PHPUnit_Framework_Error_Deprecated::$enabled;
     \PHPUnit_Framework_Error_Deprecated::$enabled = false;
     $methodName = "validate{$country}";
     $this->assertEquals(ZipCode::$methodName($code), $result);
     \PHPUnit_Framework_Error_Deprecated::$enabled = $enabled;
 }
Beispiel #4
0
 public function testWithCallback()
 {
     DeprecatedError::$enabled = false;
     $this->assertSame('value', with(function () {
         return 'value';
     }, function ($value) {
         return $value;
     }));
     DeprecatedError::$enabled = true;
 }
 public function testCheckGetTablePrimaryKey()
 {
     \PHPUnit_Framework_Error_Deprecated::$enabled = false;
     $testModel = new TestModel();
     $this->assertEquals("test_model_id", @$testModel->getTablePrimaryKey());
     \PHPUnit_Framework_Error_Deprecated::$enabled = true;
 }
<?php

$file = __DIR__ . '/../vendor/autoload.php';
if (!file_exists($file)) {
    throw new RuntimeException('Install dependencies to run test suite. "php composer.phar install --dev"');
}
require_once $file;
// disable the deprecation warnings
PHPUnit_Framework_Error_Deprecated::$enabled = FALSE;
Beispiel #7
0
 /**
  * testInvalidIsbn10
  *
  * @param mixed $isbn10
  *
  * @dataProvider getInvalidIsbn10
  *
  * @return void
  */
 public function testInvalidIsbn10($isbn10)
 {
     \PHPUnit_Framework_Error_Deprecated::$enabled = false;
     $this->assertFalse(Isbn10::validate($isbn10));
     \PHPUnit_Framework_Error_Deprecated::$enabled = true;
 }