Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit a78cbf1

Browse files
committed
testing class name collisions
1 parent 0bfebc7 commit a78cbf1

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

tests/pFFA-Basic-Test.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22
error_reporting(E_ALL);
3-
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
3+
if(!class_exists('phpFITFileAnalysis')) {
4+
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
5+
}
46

5-
class FitTest extends PHPUnit_Framework_TestCase
7+
class BasicTest extends PHPUnit_Framework_TestCase
68
{
79
private $base_dir;
810
private $demo_files = [];
@@ -15,7 +17,7 @@ public function setUp()
1517
public function testDemoFilesExist()
1618
{
1719
$this->demo_files = array_values(array_diff(scandir($this->base_dir), array('..', '.')));
18-
$this->assertEquals(['mountain-biking.fit', 'power-analysis.fit', 'swim_demo.fit'], $this->demo_files);
20+
$this->assertEquals(['mountain-biking.fit', 'power-analysis.fit', 'road-cycling.fit', 'swim_demo.fit'], $this->demo_files);
1921
var_dump($this->demo_files);
2022
}
2123

tests/pFFA-Fix_Data-Test.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22
error_reporting(E_ALL);
3-
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
3+
if(!class_exists('phpFITFileAnalysis')) {
4+
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
5+
}
46

5-
class FitTest extends PHPUnit_Framework_TestCase
7+
class FixDataTest extends PHPUnit_Framework_TestCase
68
{
79
private $base_dir;
810
private $filename = 'road-cycling.fit';

tests/pFFA-Set_Units-Test.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22
error_reporting(E_ALL);
3-
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
3+
if(!class_exists('phpFITFileAnalysis')) {
4+
require __DIR__ . '/../src/php-FIT-File-Analysis.php';
5+
}
46

5-
class FitTest extends PHPUnit_Framework_TestCase
7+
class SetUnitsTest extends PHPUnit_Framework_TestCase
68
{
79
private $base_dir;
810
private $filename = 'road-cycling.fit';

0 commit comments

Comments
 (0)