From 8538cb9ee202d4c77a9c60d389ccb672f99f5e84 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 19 Mar 2013 12:57:48 +0100 Subject: [PATCH] Removed deprecated YamlFixture->saveIntoDatabase() usage --- tests/testing/YamlFixtureTest.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/testing/YamlFixtureTest.php b/tests/testing/YamlFixtureTest.php index 0a0c9bf6b..6639f15f7 100644 --- a/tests/testing/YamlFixtureTest.php +++ b/tests/testing/YamlFixtureTest.php @@ -38,23 +38,24 @@ class YamlFixtureTest extends SapphireTest { } public function testSQLInsert() { + $factory = new FixtureFactory(); $relPath = FRAMEWORK_DIR . '/tests/testing/YamlFixtureTest.yml'; $fixture = Injector::inst()->create('YamlFixture', $relPath); - $fixture->saveIntoDatabase(DataModel::inst()); + $fixture->writeInto($factory); - $this->assertGreaterThan(0, $fixture->idFromFixture("YamlFixtureTest_DataObject", "testobject1")); + $this->assertGreaterThan(0, $factory->getId("YamlFixtureTest_DataObject", "testobject1")); $object1 = DataObject::get_by_id( "YamlFixtureTest_DataObject", - $fixture->idFromFixture("YamlFixtureTest_DataObject", "testobject1") + $factory->getId("YamlFixtureTest_DataObject", "testobject1") ); $this->assertTrue( $object1->ManyMany()->Count() == 2, "Should be two items in this relationship" ); - $this->assertGreaterThan(0, $fixture->idFromFixture("YamlFixtureTest_DataObject", "testobject2")); + $this->assertGreaterThan(0, $factory->getId("YamlFixtureTest_DataObject", "testobject2")); $object2 = DataObject::get_by_id( "YamlFixtureTest_DataObject", - $fixture->idFromFixture("YamlFixtureTest_DataObject", "testobject2") + $factory->getId("YamlFixtureTest_DataObject", "testobject2") ); $this->assertTrue( $object2->ManyMany()->Count() == 1,