| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 11 | 
| Code Lines | 8 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 8 | public function testNoAddButtonInGridField()  | 
            ||
| 9 |     { | 
            ||
| 10 | $modelAdmin = new DMSDocumentCartAdmin;  | 
            ||
| 11 |         $modelAdmin->setRequest(new SS_HTTPRequest('GET', '/')); | 
            ||
| 12 | $modelAdmin->init();  | 
            ||
| 13 | |||
| 14 | $fields = $modelAdmin->getEditForm()->Fields();  | 
            ||
| 15 |         $this->assertInstanceOf('GridField', $fields->first()); | 
            ||
| 16 | $config = $fields->first()->getConfig();  | 
            ||
| 17 |         $this->assertNull($config->getComponentByType('GridFieldAddNewButton')); | 
            ||
| 18 | }  | 
            ||
| 19 | }  | 
            ||
| 20 | 
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.