Yii Framework Forum: [Error] Class 'PHPUnit_Framework_Assert' not found - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Error] Class 'PHPUnit_Framework_Assert' not found

#1 User is offline   Jonny 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 256
  • Joined: 26-December 11

Posted 28 February 2018 - 10:30 AM

I'm suddenly finding that I'm getting this message everywhere in my set of tests. And I can'ty seem to see what's changed in versions to make this happen. Here is an example test that is now failing

<?php
namespace tests\models;
use app\components\Helper;
use app\models\RepReportParams;

class ReportTest extends \Codeception\Test\Unit
{
    /**
    * @var UnitTester
    */
    protected $tester;

    public function testTableDownLoadTime()
    {
        expect_that(is_int(Helper::getLastDdlTime('REP_VT_COL')));
    }


Here is my composer details too:

"require-dev" : {
		"yiisoft/yii2-debug" : "*",
		"yiisoft/yii2-gii" : "*",
		"yiisoft/yii2-faker" : "*",
		"codeception/base" : "^2.2.3",
		"codeception/verify" : "~0.3.1",
		"codeception/specify" : "~0.4.3",
		"phpunit/php-code-coverage" : "5.2"
	},

0

#2 User is offline   QuPsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 28-April 14

Posted 01 March 2018 - 05:47 PM

Running into the same issue. I even search my project files for "PHPUnit_Framework_Assert" and to no avail. I'm still digging into the issue. If I find a solution, I'll post it here.
Complete PHP/Yii n00b, so be nice to me :)
0

#3 User is offline   greyow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-March 18

Posted 02 March 2018 - 06:14 AM

View PostJonny, on 28 February 2018 - 10:30 AM, said:


"require-dev" : {
		"yiisoft/yii2-debug" : "*",
		"yiisoft/yii2-gii" : "*",
		"yiisoft/yii2-faker" : "*",
		"codeception/base" : "^2.2.3",
		"codeception/verify" : "~0.3.1",
		"codeception/specify" : "~0.4.3",
		"phpunit/php-code-coverage" : "5.2"
	},




New codeception version needs new codeception/verify version.
This version removed PHPUnit_Framework_Assert class_alias.

"require": {
        "codeception/codeception": "^2.4",
        "codeception/specify": "^1.0",
        "codeception/verify": "^1.0"
}

0

#4 User is offline   QuPsi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 72
  • Joined: 28-April 14

Posted 03 March 2018 - 08:04 PM

If you're still having issue, run this following in your command line.

composer require codeception/codeception
composer require codeception/specify
composer require codeception/verify

Everything started working again after doing that.
Complete PHP/Yii n00b, so be nice to me :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users