本文整理汇总了PHP中PHPUnit_Framework_TestCase::markTestSkipped方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestCase::markTestSkipped方法的具体用法?PHP PHPUnit_Framework_TestCase::markTestSkipped怎么用?PHP PHPUnit_Framework_TestCase::markTestSkipped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestCase
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestCase::markTestSkipped方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
private function init()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
\PHPUnit_Framework_TestCase::markTestSkipped('This test requires SQLite support in your environment');
}
$config = new \Doctrine\ORM\Configuration();
$config->setEntityNamespaces(array('UebbHateoasBundle' => 'uebb\\HateoasBundle\\Tests\\Entity'));
$config->setAutoGenerateProxyClasses(true);
$config->setProxyDir(\sys_get_temp_dir());
$config->setProxyNamespace('UebbHateoasTests\\Doctrine');
$reader = new AnnotationReader();
$metadataDriver = new AnnotationDriver($reader, 'uebb\\HateoasBundle\\Tests\\Entity');
$config->setMetadataDriverImpl($metadataDriver);
$config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$params = array('driver' => 'pdo_sqlite', 'memory' => true);
$this->entityManager = EntityManager::create($params, $config);
$this->linkParser = $this->getMock('uebb\\HateoasBundle\\Service\\LinkParserInterface');
$this->linkResolver = $this->getMock('uebb\\HateoasBundle\\Service\\LinkResolverInterface');
$this->dispatcher = $this->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
$this->formResolver = new FormResolver($this->factory, $reader);
$this->queryParser = $this->getMock('uebb\\HateoasBundle\\Service\\QueryParserInterface');
$this->serializer = $this->getMock('JMS\\Serializer\\SerializerInterface');
$this->validator = $this->getMock('Symfony\\Component\\Validator\\Validator\\ValidatorInterface');
$this->requestProcessor = new RequestProcessor($this->entityManager, $this->linkParser, $this->linkResolver, $this->formResolver, $this->dispatcher, $this->queryParser, $this->serializer, $this->validator);
}
示例2: loadConfig
protected function loadConfig()
{
@(include $this->filename);
if (!isset($GLOBALS['Blorgy_FunctionalTest_Config']) || !is_array($GLOBALS['Blorgy_FunctionalTest_Config'])) {
$this->test->markTestSkipped('Functional test configuration is missing.');
}
$config = $GLOBALS['Blorgy_FunctionalTest_Config'];
if (!isset($config['working_dir']) || !isset($config['instance']) || !isset($config['base_href'])) {
$this->test->markTestSkipped('Functional test configuration is missing or incorrect.');
}
$this->instance = $config['instance'];
if (strpos($config['base_href'], '%s') === false) {
$this->base_href = $config['base_href'];
} else {
$this->base_href = sprintf($config['base_href'], $config['instance'], $config['working_dir']);
}
}
示例3: __construct
/**
* Registers vfsStream
*
* @param PHPUnit_Framework_TestCase $testCase
*
* @return vfsStreamHelper_Wrapper
*/
public function __construct(PHPUnit_Framework_TestCase $testCase, $mountPoint = 'root')
{
@(include_once 'vfsStream/vfsStream.php');
if (!class_exists('vfsStreamWrapper')) {
$testCase->markTestSkipped('vfsStream is not available - skipping');
} else {
vfsStream::setup($mountPoint);
}
}
示例4: createTestEntityManager
/**
* Returns an entity manager for testing.
*
* @param Configuration|null $config
*
* @return EntityManager
*/
public static function createTestEntityManager(Configuration $config = null)
{
if (!extension_loaded('pdo_sqlite')) {
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
}
if (null === $config) {
$config = self::createTestConfiguration();
}
$params = array('driver' => 'pdo_sqlite', 'memory' => true);
return EntityManager::create($params, $config);
}
示例5: createTestEntityManager
/**
* Returns an entity manager for testing.
*
* @return EntityManager
*/
public static function createTestEntityManager()
{
if (!extension_loaded('pdo_sqlite')) {
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
}
$config = new \Doctrine\ORM\Configuration();
$config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\\Bridge\\Doctrine\\Tests\\Fixtures'));
$config->setAutoGenerateProxyClasses(true);
$config->setProxyDir(\sys_get_temp_dir());
$config->setProxyNamespace('SymfonyTests\\Doctrine');
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader()));
$config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$params = array('driver' => 'pdo_sqlite', 'memory' => true);
return EntityManager::create($params, $config);
}
示例6: createTestEntityManager
/**
* Returns an entity manager for testing.
*
* @return EntityManager
*/
public static function createTestEntityManager()
{
if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
\PHPUnit_Framework_TestCase::markTestSkipped('This test requires SQLite support in your environment');
}
$config = new \Doctrine\ORM\Configuration();
$config->setEntityNamespaces(array('SymfonyTestsDoctrine' => 'Symfony\\Bridge\\Doctrine\\Tests\\Fixtures'));
$config->setAutoGenerateProxyClasses(true);
$config->setProxyDir(\sys_get_temp_dir());
$config->setProxyNamespace('SymfonyTests\\Doctrine');
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader()));
$config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
$params = array('driver' => 'pdo_sqlite', 'memory' => true);
return EntityManager::create($params, $config);
}
示例7: processResults
/**
* Analyze results of aggregated tests execution and complete test case appropriately
*
* @param array $results
* @param int $passed
* @return void
*/
protected function processResults(array $results, $passed)
{
$totalCountsMessage = sprintf('Passed: %d, Failed: %d, Incomplete: %d, Skipped: %d.', $passed, count($results['PHPUnit_Framework_AssertionFailedError']), count($results['PHPUnit_Framework_IncompleteTestError']), count($results['PHPUnit_Framework_SkippedTestError']));
if ($results['PHPUnit_Framework_AssertionFailedError']) {
$this->_testCase->fail($totalCountsMessage . PHP_EOL . implode(PHP_EOL, $results['PHPUnit_Framework_AssertionFailedError']));
}
if (!$results['PHPUnit_Framework_IncompleteTestError'] && !$results['PHPUnit_Framework_SkippedTestError']) {
return;
}
$message = $totalCountsMessage . PHP_EOL . implode(PHP_EOL, $results['PHPUnit_Framework_IncompleteTestError']) . PHP_EOL . implode(PHP_EOL, $results['PHPUnit_Framework_SkippedTestError']);
if ($results['PHPUnit_Framework_IncompleteTestError']) {
$this->_testCase->markTestIncomplete($message);
} elseif ($results['PHPUnit_Framework_SkippedTestError']) {
$this->_testCase->markTestSkipped($message);
}
}
示例8: loadConfig
protected function loadConfig()
{
@(include $this->filename);
if (!isset($GLOBALS['FunctionalTest_Config']) || !is_array($GLOBALS['FunctionalTest_Config'])) {
$this->test->markTestSkipped('Functional test configuration is missing.');
}
$config = $GLOBALS['FunctionalTest_Config'];
if (!isset($config['working_dir']) || !isset($config['base_href'])) {
$this->test->markTestSkipped('Functional test configuration is missing or incorrect.');
}
if (isset($config['instance'])) {
$this->instance = $config['instance'];
}
if (isset($config['domain'])) {
$this->domain = $config['domain'];
}
if (strpos($config['base_href'], '%s') === false) {
$this->base_href = $config['base_href'];
} elseif ($this->instance == '') {
$this->base_href = sprintf($config['base_href'], $config['working_dir']);
} else {
$this->base_href = sprintf($config['base_href'], $this->instance, $config['working_dir']);
}
if (isset($config['screenshot_path'])) {
$this->screenshot_path = $config['screenshot_path'];
}
if (isset($config['screenshot_url'])) {
$this->screenshot_url = $config['screenshot_url'];
}
if (isset($config['selenium_host'])) {
$this->selenium_host = $config['selenium_host'];
}
if (isset($config['selenium_port'])) {
$this->selenium_port = (int) $config['selenium_port'];
}
}
示例9: skip
/**
* http://www.phpunit.de/manual/current/en/incomplete-and-skipped-tests.html
*
* @see lime_test#skip()
*
* @param string $message
* @param int $nb_tests
*/
public function skip($message = '', $nb_tests = 1)
{
$this->testCase->markTestSkipped($message . ($message ? ', ' : '') . 'nb_tests: ' . $nb_tests);
}
示例10: require64Bit
/**
* Skips the test unless the current system has a 64bit architecture.
*/
public static function require64Bit(\PHPUnit_Framework_TestCase $testCase)
{
if (8 !== PHP_INT_SIZE) {
$testCase->markTestSkipped('PHP 64 bit is required.');
}
}
示例11: markTestSkipped
/**
* Mark this test as skipped. Puts extra information in the logs.
*
* @param string $message
*/
public static function markTestSkipped($message = '')
{
$backtrace = wfDebugBacktrace(3);
$entry = $backtrace[1];
Wikia::log(wfFormatStackFrame($entry), false, "marked as skipped - {$message}");
parent::markTestSkipped($message);
}
示例12: markTestSkipped
public static function markTestSkipped($message = '')
{
Wikia::log(__METHOD__, '', $message);
parent::markTestSkipped($message);
}
示例13: requiredBy
/**
*
*/
public static function requiredBy(PHPUnit_Framework_TestCase $Case)
{
if (!Runkit::isEnabled()) {
$Case->markTestSkipped('Runkit must be enabled');
}
}
示例14: assertPhpUnit
/**
* Profiles the callback and test the result against the given configuration.
*/
public function assertPhpUnit(\PHPUnit_Framework_TestCase $testCase, Profile\Configuration $config, $callback)
{
if (!$config->hasMetadata('skip_timeline')) {
$config->setMetadata('skip_timeline', 'true');
}
try {
$probe = $this->createProbe($config);
$callback();
$profile = $this->endProbe($probe);
$testCase->assertThat($profile, new BlackfireConstraint());
} catch (Exception\ExceptionInterface $e) {
$testCase->markTestSkipped($e->getMessage());
}
return $profile;
}