2016-06-03 2 views
0

계속 하시겠습니까 No tests found in class "AlliancesObjectTest". VM과 내 컴퓨터에서 실행하려고했지만 작동하지 않습니다.PHPUnit 테스트에서 "AlliancesObjectTest"클래스에서 테스트가 없습니다.

이 단말기 tests\phpunit.php

<?php 
require_once __DIR__ . '/../vendor/autoload.php'; 

전체 응답 phpunit.xml

<phpunit bootstrap="./tests/phpunit.php"> 

    <testsuite name="unit"> 
     <directory>./tests</directory> 
    </testsuite> 

    <filter> 
     <whitelist> 
      <directory>./src</directory> 
     </whitelist> 
    </filter> 

    <logging> 
     <log type="coverage-clover" target="build/logs/clover.xml"/> 
    </logging> 

</phpunit> 

내용 tests\AlliancesObjectTest

<?php 

use \phpunit\framework\TestCase; 

class AlliancesObjectTest extends TestCase 
{ 
    /** @test */ 
    public function testPushAndPop() 
    { 
     $stack = []; 
     $this->assertEquals(0, count($stack)); 

     array_push($stack, 'foo'); 
     $this->assertEquals('foo', $stack[count($stack)-1]); 
     $this->assertEquals(1, count($stack)); 

     $this->assertEquals('foo', array_pop($stack)); 
     $this->assertEquals(0, count($stack)); 
    } 
} 

콘텐츠의 내용이다 : 0

[email protected]:~/xxxxxxx$ phpunit -v 
PHPUnit 5.4.2 by Sebastian Bergmann and contributors. 

Runtime:  PHP 7.0.2-4+deb.sury.org~trusty+1 with Xdebug 2.4.0RC3 
Configuration: /home/vagrant/xxxxxxx/phpunit.xml 

W              1/1 (100%) 

Time: 225 ms, Memory: 4.00MB 

There was 1 warning: 

1) Warning 
No tests found in class "AlliancesObjectTest". 

WARNINGS! 
Tests: 1, Assertions: 0, Warnings: 1. 

Generating code coverage report in Clover XML format ... done 
+0

메소드의 이름 앞에'test'가 붙어있는 경우'@ test' 주석이 필요 없습니다. –

답변

0

PHPUnit 5.4.4 버전이 수정되었습니다.

관련 문제