Beispiel #1
0
 /**
  * Тестируем каскадное удаление
  */
 public function testRecursiveRemoving()
 {
     $document = new TestDocument();
     $document->name = 'Test inserting';
     $document->insert();
     $nRoot = Sitemap::addPage('Test inserting', 'xx', TestDocument::ModelName, 1, 0);
     $document = new TestDocument();
     $document->name = 'Test inserting2';
     $document->insert();
     Sitemap::addPage('Test inserting2', 'xx', TestDocument::ModelName, 2, $nRoot);
     //
     Sitemap::removeDocument(TestDocument::ModelName, '1');
     // Проверяем удаление из бд
     $result = DB::get(sprintf('SELECT COUNT(*) as `count` FROM `%s`', TestDocument::TableName));
     $this->assertEquals($result['count'], 0);
 }