| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function testSaveWithTrigger(): void |
||
| 21 | { |
||
| 22 | $this->checkFixture($this->db(), 'test_trigger'); |
||
| 23 | |||
| 24 | // drop trigger if exist |
||
| 25 | $sql = <<<SQL |
||
| 26 | IF (OBJECT_ID('[dbo].[test_alert]') IS NOT NULL) |
||
| 27 | BEGIN |
||
| 28 | DROP TRIGGER [dbo].[test_alert]; |
||
| 29 | END |
||
| 30 | SQL; |
||
| 31 | $this->db()->createCommand($sql)->execute(); |
||
| 32 | |||
| 33 | // create trigger |
||
| 34 | $sql = <<<SQL |
||
| 35 | CREATE TRIGGER [dbo].[test_alert] ON [dbo].[test_trigger] |
||
| 36 | AFTER INSERT |
||
| 37 | AS |
||
| 38 | BEGIN |
||
| 39 | INSERT INTO [dbo].[test_trigger_alert] ( [stringcol] ) |
||
| 40 | SELECT [stringcol] |
||
| 41 | FROM [inserted] |
||
| 42 | END |
||
| 43 | SQL; |
||
| 44 | $this->db()->createCommand($sql)->execute(); |
||
| 45 | |||
| 46 | $record = new TestTrigger($this->db()); |
||
| 47 | |||
| 48 | $record->stringcol = 'test'; |
||
| 49 | |||
| 50 | $this->assertTrue($record->save()); |
||
| 51 | $this->assertEquals(1, $record->id); |
||
| 52 | |||
| 53 | $testRecordQuery = new ActiveQuery(TestTriggerAlert::class); |
||
| 54 | |||
| 55 | $this->assertEquals('test', $testRecordQuery->findOne(1)->stringcol); |
||
| 56 | } |
||
| 58 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths