Skip to content
Permalink
Browse files

Decouple composer table tests

  • Loading branch information
m-kuhn committed Jun 16, 2015
1 parent 27fb4dc commit 3dbe7f5e0c19ec59667d911f8fdd757cf2a5d3ae
@@ -94,9 +94,28 @@ void TestQgsComposerTableV2::initTestCase()
"ogr" );
QgsMapLayerRegistry::instance()->addMapLayer( mVectorLayer );

//create composition with composer map
mMapSettings.setLayers( QStringList() << mVectorLayer->id() );
mMapSettings.setCrsTransformEnabled( false );

mReport = "<h1>Composer TableV2 Tests</h1>\n";
}

void TestQgsComposerTableV2::cleanupTestCase()
{
QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
QgsApplication::exitQgis();
}

void TestQgsComposerTableV2::init()
{
//create composition with composer map
mComposition = new QgsComposition( mMapSettings );
mComposition->setPaperSize( 297, 210 ); //A4 portrait

@@ -118,31 +137,11 @@ void TestQgsComposerTableV2::initTestCase()
mComposerAttributeTable->setContentFont( QgsFontUtils::getStandardTestFont() );
mComposerAttributeTable->setHeaderFont( QgsFontUtils::getStandardTestFont() );
mComposerAttributeTable->setBackgroundColor( Qt::yellow );

mReport = "<h1>Composer TableV2 Tests</h1>\n";
}

void TestQgsComposerTableV2::cleanupTestCase()
{
delete mComposition;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
QgsApplication::exitQgis();
}

void TestQgsComposerTableV2::init()
{
}

void TestQgsComposerTableV2::cleanup()
{
delete mComposition;
}

void TestQgsComposerTableV2::attributeTableHeadings()
Binary file not shown.
Binary file not shown.

0 comments on commit 3dbe7f5

Please sign in to comment.
You can’t perform that action at this time.