Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Jun 17, 2017
1 parent 483655a commit 0e63c61
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 18 deletions.
5 changes: 3 additions & 2 deletions tests/Integration/docblock/factoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
namespace TheSeer\phpDox\Tests\Integration\DocBlock {

use TheSeer\phpDox\DocBlock\Factory;
use TheSeer\phpDox\FactoryInterface;

/**
* Class FactoryTest
*
* @covers TheSeer\phpDox\DocBlock\Factory
*/
class FactoryTest extends \PHPUnit_Framework_TestCase {
class FactoryTest extends \PHPUnit\Framework\TestCase {

/**
* @covers TheSeer\phpDox\DocBlock\Factory::getElementInstanceFor
Expand Down Expand Up @@ -104,7 +105,7 @@ public function testGetInstanceByMap($expected, $name, $elementMap) {
*/
public function testGetInstanceByMapHandlingAFactory() {

$factoryMock = $this->getMock('TheSeer\\phpDox\\FactoryInterface');
$factoryMock = $this->createMock(FactoryInterface::class);
$factoryMock
->expects($this->once())
->method('getInstanceFor')
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/docblock/parserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @ uses TheSeer\phpDox\DocBlock\Factory
* @ covers TheSeer\phpDox\DocBlock\Parser
*/
class ParserTest extends \PHPUnit_Framework_TestCase {
class ParserTest extends \PHPUnit\Framework\TestCase {

/**
* @ covers TheSeer\phpDox\DocBlock\Parser::__construct
Expand Down
5 changes: 3 additions & 2 deletions tests/Integration/factoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*/
namespace TheSeer\phpDox\Tests\Integration {

use TheSeer\phpDox\CollectorConfig;
use TheSeer\phpDox\Factory;
use TheSeer\phpDox\FileInfo;
use TheSeer\phpDox\Version;
Expand All @@ -47,7 +48,7 @@
* @covers TheSeer\phpDox\Factory
* @uses TheSeer\phpDox\version
*/
class FactoryTest extends \PHPUnit_Framework_TestCase {
class FactoryTest extends \PHPUnit\Framework\TestCase {

/**
* @var Factory
Expand Down Expand Up @@ -83,7 +84,7 @@ public function testGetApplication() {
* @uses TheSeer\phpDox\DocBlock\Parser
*/
public function testGetCollector() {
$config = $this->getMockBuilder('TheSeer\\phpDox\\CollectorConfig')
$config = $this->getMockBuilder(CollectorConfig::class)
->disableOriginalConstructor()
->getMock();

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/DirectoryCleanerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
namespace TheSeer\phpDox {

class DirectoryCleanerTest extends \PHPUnit_Framework_TestCase {
class DirectoryCleanerTest extends \PHPUnit\Framework\TestCase {

/**
* @var DirectoryCleaner
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/config/GlobalConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @uses TheSeer\phpDox\FileInfo
* @uses TheSeer\phpDox\Version
*/
class GlobalConfigTest extends \PHPUnit_Framework_TestCase {
class GlobalConfigTest extends \PHPUnit\Framework\TestCase {

private $baseDir;

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/docblock/docblockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @covers TheSeer\phpDox\DocBlock\DocBlock
* @uses TheSeer\phpDox\DocBlock\GenericElement
*/
class DocBlockTest extends \PHPUnit_Framework_TestCase {
class DocBlockTest extends \PHPUnit\Framework\TestCase {

/**
* @var DocBlock
Expand Down
7 changes: 4 additions & 3 deletions tests/Unit/docblock/factoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@

use TheSeer\fDOM\fDOMDocument;
use TheSeer\phpDox\DocBlock\Factory;
use TheSeer\phpDox\FactoryInterface;

/**
* Class FactoryTest
*
* @covers TheSeer\phpDox\DocBlock\Factory
*/
class FactoryTest extends \PHPUnit_Framework_TestCase {
class FactoryTest extends \PHPUnit\Framework\TestCase {

private $factory;

Expand All @@ -58,7 +59,7 @@ protected function setUp() {
* @covers TheSeer\phpDox\DocBlock\Factory::addParserFactory
*/
public function testAddParserFactory() {
$mock = $this->getMock('TheSeer\\phpdox\\FactoryInterface');
$mock = $this->createMock(FactoryInterface::class);
$this->factory->addParserFactory('Tux', $mock);
$this->assertAttributeContains($mock, 'parserMap', $this->factory);
}
Expand All @@ -68,7 +69,7 @@ public function testAddParserFactory() {
* @covers TheSeer\phpDox\DocBlock\Factory::addParserFactory
*/
public function testAddParserFactoryExpectingFactoryException() {
$mock = $this->getMock('TheSeer\\phpdox\\FactoryInterface');
$mock = $this->createMock(FactoryInterface::class);
$this->factory->addParserFactory(array(), $mock);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/docblock/invalidelementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
* @uses TheSeer\phpDox\DocBlock\InvalidElement
* @uses TheSeer\phpDox\DocBlock\GenericElement
*/
class InvalidElementTest extends \PHPUnit_Framework_TestCase {
class InvalidElementTest extends \PHPUnit\Framework\TestCase {

/**
* @covers TheSeer\phpDox\DocBlock\InvalidElement::asDom
*/
public function testElementCanBeSerializedToDom() {
$dom = new fDOMDocument();
$element = new InvalidElement($this->getMock('TheSeer\phpDox\DocBlock\Factory'), 'test');
$element = new InvalidElement($this->createMock(\TheSeer\phpDox\DocBlock\Factory::class), 'test');

$this->assertEquals(
'<invalid xmlns="http://xml.phpdox.net/src" annotation="test"/>',
Expand Down
6 changes: 2 additions & 4 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright (c) 2010-2015 Arne Blankerts <[email protected]>
* Copyright (c) 2010-2017 Arne Blankerts <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -37,6 +37,4 @@
*/

require __DIR__ . '/../src/autoload.php';
$vendor = __DIR__ . '/../vendor';
require __DIR__ . '/../src/vendor.php';

require __DIR__ . '/../vendor/autoload.php';
2 changes: 1 addition & 1 deletion tests/data/coverage/PHPUnitEnricherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use TheSeer\phpDox\Generator\Enricher;
use TheSeer\phpDox\Generator\Enricher\PHPUnitConfig;

class PHPUnitEnricherTest extends \PHPUnit_Framework_TestCase {
class PHPUnitEnricherTest extends \PHPUnit\Framework\TestCase {


public function testCoverageInformationIsImportedProperly() {
Expand Down

0 comments on commit 0e63c61

Please sign in to comment.