mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 18:47:33 +08:00 
			
		
		
		
	Change @expectException with $this->expectException.
				
					
				
			This commit is contained in:
		| @ -215,19 +215,15 @@ class FixtureControllerTest extends DatabaseTestCase | |||||||
|         $this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should not be loaded'); |         $this->assertEmpty(FixtureStorage::$firstFixtureData, 'first fixture data should not be loaded'); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * @expectedException \yii\console\Exception |  | ||||||
|      */ |  | ||||||
|     public function testNoFixturesWereFoundInLoad() |     public function testNoFixturesWereFoundInLoad() | ||||||
|     { |     { | ||||||
|  |         $this->expectException('\yii\console\Exception'); | ||||||
|         $this->_fixtureController->actionLoad(['NotExistingFixture']); |         $this->_fixtureController->actionLoad(['NotExistingFixture']); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * @expectedException \yii\console\Exception |  | ||||||
|      */ |  | ||||||
|     public function testNoFixturesWereFoundInUnload() |     public function testNoFixturesWereFoundInUnload() | ||||||
|     { |     { | ||||||
|  |         $this->expectException('\yii\console\Exception'); | ||||||
|         $this->_fixtureController->actionUnload(['NotExistingFixture']); |         $this->_fixtureController->actionUnload(['NotExistingFixture']); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -323,7 +323,7 @@ CODE; | |||||||
|  |  | ||||||
|         $output = $this->runMigrateControllerAction('new'); |         $output = $this->runMigrateControllerAction('new'); | ||||||
|         $this->assertSame(ExitCode::OK, $this->getExitCode()); |         $this->assertSame(ExitCode::OK, $this->getExitCode()); | ||||||
|         $this->assertNotContains('_test_new1', $output); |         $this->assertStringNotContainsString('_test_new1', $output); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public function testMark() |     public function testMark() | ||||||
| @ -418,7 +418,7 @@ CODE; | |||||||
|         $this->assertSame(ExitCode::OK, $this->getExitCode()); |         $this->assertSame(ExitCode::OK, $this->getExitCode()); | ||||||
|         $files = FileHelper::findFiles($this->migrationPath); |         $files = FileHelper::findFiles($this->migrationPath); | ||||||
|         $fileContent = file_get_contents($files[0]); |         $fileContent = file_get_contents($files[0]); | ||||||
|         $this->assertNotContains("namespace {$this->migrationNamespace};", $fileContent); |         $this->assertStringNotContainsString("namespace {$this->migrationNamespace};", $fileContent); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|  | |||||||
| @ -619,8 +619,7 @@ SQL; | |||||||
|      * Test INSERT INTO ... SELECT SQL statement with wrong query object. |      * Test INSERT INTO ... SELECT SQL statement with wrong query object. | ||||||
|      * |      * | ||||||
|      * @dataProvider invalidSelectColumns |      * @dataProvider invalidSelectColumns | ||||||
|      * @expectedException \yii\base\InvalidParamException |      *  | ||||||
|      * @expectedExceptionMessage Expected select query object with enumerated (named) parameters |  | ||||||
|      * @param mixed $invalidSelectColumns |      * @param mixed $invalidSelectColumns | ||||||
|      */ |      */ | ||||||
|     public function testInsertSelectFailed($invalidSelectColumns) |     public function testInsertSelectFailed($invalidSelectColumns) | ||||||
| @ -634,6 +633,8 @@ SQL; | |||||||
|         $this->expectException(\yii\base\InvalidArgumentException::class); |         $this->expectException(\yii\base\InvalidArgumentException::class); | ||||||
|         $this->expectExceptionMessage('Expected select query object with enumerated (named) parameters'); |         $this->expectExceptionMessage('Expected select query object with enumerated (named) parameters'); | ||||||
|  |  | ||||||
|  |         $this->expectException('yii\base\InvalidParamException'); | ||||||
|  |         $this->expectExceptionMessage('Expected select query object with enumerated (named) parameters'); | ||||||
|         $command->insert('{{customer}}', $query)->execute(); |         $command->insert('{{customer}}', $query)->execute(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | |||||||
| @ -224,9 +224,6 @@ abstract class ConnectionTest extends DatabaseTestCase | |||||||
|         $this->assertTrue(true); // should not be any exception so far |         $this->assertTrue(true); // should not be any exception so far | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * @expectedException \Exception |  | ||||||
|      */ |  | ||||||
|     public function testTransactionShortcutException() |     public function testTransactionShortcutException() | ||||||
|     { |     { | ||||||
|         $connection = $this->getConnection(true); |         $connection = $this->getConnection(true); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Wilmer Arambula
					Wilmer Arambula