public function testLoadBackupViewCLIWarn()
 {
     $this->simulateLogin('*****@*****.**', true);
     $controller = new BackupController(true);
     $results = $controller->control();
     $this->assertPattern('/Back Up Your ThinkUp Data/', $results);
     $v_mgr = $controller->getViewManager();
     $this->assertNull($v_mgr->getTemplateDataItem('high_table_row_count'));
     // table row counts are bad
     $old_count = UpgradeController::$WARN_TABLE_ROW_COUNT;
     UpgradeController::$WARN_TABLE_ROW_COUNT = 2;
     $results = $controller->control();
     $this->assertPattern('/we recommend that you use the/', $results);
     $table_counts = $v_mgr->getTemplateDataItem('high_table_row_count');
     $this->assertNotNull($table_counts);
     $this->assertNotNull(3, $table_counts['count']);
     // tu_plugins, defaults to three
     UpgradeController::$WARN_TABLE_ROW_COUNT = $old_count;
 }
 public function testDatabaseMigrationNeededHighTableCount()
 {
     // create test migration sql
     $this->migrationFiles(1);
     // table row counts are good
     $this->simulateLogin('*****@*****.**', true);
     $controller = new UpgradeController(true);
     $results = $controller->go();
     $this->assertPattern('/needs 1 database update/', $results);
     $v_mgr = $controller->getViewManager();
     $this->assertNull($v_mgr->getTemplateDataItem('high_table_row_count'));
     // table row counts are bad
     $old_count = UpgradeController::$WARN_TABLE_ROW_COUNT;
     UpgradeController::$WARN_TABLE_ROW_COUNT = 2;
     $this->simulateLogin('*****@*****.**', true);
     $controller = new UpgradeController(true);
     $results = $controller->go();
     $this->assertPattern('/we recommend that you use the.*command line upgrade tool.*when upgrading ThinkUp/sm', $results);
     $this->assertPattern('/needs 1 database update/', $results);
     $v_mgr = $controller->getViewManager();
     $table_counts = $v_mgr->getTemplateDataItem('high_table_row_count');
     $this->assertNotNull($table_counts);
     $this->assertNotNull(3, $table_counts['count']);
     // tu_plugins, defaults to three
     UpgradeController::$WARN_TABLE_ROW_COUNT = $old_count;
 }