| Conditions | 1 |
| Paths | 1 |
| Total Lines | 36 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function testSaveWithTrigger(): void |
||
| 32 | { |
||
| 33 | $this->checkFixture($this->db, 'test_trigger'); |
||
| 34 | |||
| 35 | // drop trigger if exist |
||
| 36 | $sql = <<<SQL |
||
| 37 | IF (OBJECT_ID('[dbo].[test_alert]') IS NOT NULL) |
||
| 38 | BEGIN |
||
| 39 | DROP TRIGGER [dbo].[test_alert]; |
||
| 40 | END |
||
| 41 | SQL; |
||
| 42 | $this->db->createCommand($sql)->execute(); |
||
| 43 | |||
| 44 | // create trigger |
||
| 45 | $sql = <<<SQL |
||
| 46 | CREATE TRIGGER [dbo].[test_alert] ON [dbo].[test_trigger] |
||
| 47 | AFTER INSERT |
||
| 48 | AS |
||
| 49 | BEGIN |
||
| 50 | INSERT INTO [dbo].[test_trigger_alert] ( [stringcol] ) |
||
| 51 | SELECT [stringcol] |
||
| 52 | FROM [inserted] |
||
| 53 | END |
||
| 54 | SQL; |
||
| 55 | $this->db->createCommand($sql)->execute(); |
||
| 56 | |||
| 57 | $record = new TestTrigger($this->db); |
||
| 58 | |||
| 59 | $record->stringcol = 'test'; |
||
| 60 | |||
| 61 | $this->assertTrue($record->save()); |
||
| 62 | $this->assertEquals(1, $record->id); |
||
| 63 | |||
| 64 | $testRecordQuery = new ActiveQuery(TestTriggerAlert::class, $this->db); |
||
| 65 | |||
| 66 | $this->assertEquals('test', $testRecordQuery->findOne(1)->stringcol); |
||
| 67 | } |
||
| 69 |
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