(t *testing.T, content string)
| 554 | } |
| 555 | |
| 556 | func testStubBasicStructure(t *testing.T, content string) { |
| 557 | requiredElements := []string{ |
| 558 | "<?php", |
| 559 | "/** @generate-class-entries */", |
| 560 | } |
| 561 | |
| 562 | for _, element := range requiredElements { |
| 563 | assert.Contains(t, content, element, "Stub file should contain: %s", element) |
| 564 | } |
| 565 | |
| 566 | lines := strings.Split(content, "\n") |
| 567 | if len(lines) > 0 { |
| 568 | assert.Equal(t, "<?php", strings.TrimSpace(lines[0]), "Stub file should start with <?php") |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | func testStubFunctions(t *testing.T, content string, functions []phpFunction) { |
| 573 | for _, fn := range functions { |
no outgoing calls
no test coverage detected