~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/phpunit/php-code-coverage/tests/PHP/CodeCoverage/Report/CloverTest.php

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * This file is part of the PHP_CodeCoverage package.
 
4
 *
 
5
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 
6
 *
 
7
 * For the full copyright and license information, please view the LICENSE
 
8
 * file that was distributed with this source code.
 
9
 */
 
10
 
 
11
if (!defined('TEST_FILES_PATH')) {
 
12
    define(
 
13
      'TEST_FILES_PATH',
 
14
      dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR .
 
15
      '_files' . DIRECTORY_SEPARATOR
 
16
    );
 
17
}
 
18
 
 
19
require_once TEST_FILES_PATH . '../TestCase.php';
 
20
 
 
21
/**
 
22
 * Tests for the PHP_CodeCoverage_Report_Clover class.
 
23
 *
 
24
 * @category   PHP
 
25
 * @package    CodeCoverage
 
26
 * @subpackage Tests
 
27
 * @author     Sebastian Bergmann <sebastian@phpunit.de>
 
28
 * @copyright  Sebastian Bergmann <sebastian@phpunit.de>
 
29
 * @license    http://www.opensource.org/licenses/BSD-3-Clause  The BSD 3-Clause License
 
30
 * @link       http://github.com/sebastianbergmann/php-code-coverage
 
31
 * @since      Class available since Release 1.0.0
 
32
 */
 
33
class PHP_CodeCoverage_Report_CloverTest extends PHP_CodeCoverage_TestCase
 
34
{
 
35
    /**
 
36
     * @covers PHP_CodeCoverage_Report_Clover
 
37
     */
 
38
    public function testCloverForBankAccountTest()
 
39
    {
 
40
        $clover = new PHP_CodeCoverage_Report_Clover;
 
41
 
 
42
        $this->assertStringMatchesFormatFile(
 
43
          TEST_FILES_PATH . 'BankAccount-clover.xml',
 
44
          $clover->process($this->getCoverageForBankAccount(), null, 'BankAccount')
 
45
        );
 
46
    }
 
47
 
 
48
    /**
 
49
     * @covers PHP_CodeCoverage_Report_Clover
 
50
     */
 
51
    public function testCloverForFileWithIgnoredLines()
 
52
    {
 
53
        $clover = new PHP_CodeCoverage_Report_Clover;
 
54
 
 
55
        $this->assertStringMatchesFormatFile(
 
56
          TEST_FILES_PATH . 'ignored-lines-clover.xml',
 
57
          $clover->process($this->getCoverageForFileWithIgnoredLines())
 
58
        );
 
59
    }
 
60
 
 
61
    /**
 
62
     * @covers PHP_CodeCoverage_Report_Clover
 
63
     */
 
64
    public function testCloverForClassWithAnonymousFunction()
 
65
    {
 
66
        $clover = new PHP_CodeCoverage_Report_Clover;
 
67
 
 
68
        $this->assertStringMatchesFormatFile(
 
69
          TEST_FILES_PATH . 'class-with-anonymous-function-clover.xml',
 
70
          $clover->process($this->getCoverageForClassWithAnonymousFunction())
 
71
        );
 
72
    }
 
73
}