Rename CharacterViewpoint::getActions() to CharacterViewpoint::getActionGroups() b/c that's what it is
This commit is contained in:
+6
-6
@@ -31,7 +31,7 @@ use LotGD\Core\Tests\CoreModelTestCase;
|
||||
|
||||
class DefaultSceneProvider implements EventHandler
|
||||
{
|
||||
public static $actions;
|
||||
public static $actionGroups;
|
||||
public static $attachments = ['actions'];
|
||||
public static $data = ['data'];
|
||||
|
||||
@@ -47,12 +47,12 @@ class DefaultSceneProvider implements EventHandler
|
||||
case 'h/lotgd/core/navigate-to/lotgd/tests/village':
|
||||
$v = $context['viewpoint'];
|
||||
|
||||
self::$actions = [new ActionGroup('default', 'Title', 0)];
|
||||
self::$actions[0]->setActions([
|
||||
self::$actionGroups = [new ActionGroup('default', 'Title', 0)];
|
||||
self::$actionGroups[0]->setActions([
|
||||
new Action(2), // This is a real sceneId in game.yml
|
||||
new Action(101),
|
||||
]);
|
||||
$v->setActions(self::$actions);
|
||||
$v->setActionGroups(self::$actionGroups);
|
||||
|
||||
$v->setAttachments(self::$attachments);
|
||||
$v->setData(self::$data);
|
||||
@@ -151,7 +151,7 @@ class GameTest extends CoreModelTestCase
|
||||
$this->assertEquals('lotgd/tests/village', $v->getTemplate());
|
||||
|
||||
// Validate the changes made by the hook.
|
||||
$this->assertSame(DefaultSceneProvider::$actions, $v->getActions());
|
||||
$this->assertSame(DefaultSceneProvider::$actionGroups, $v->getActionGroups());
|
||||
$this->assertSame(DefaultSceneProvider::$attachments, $v->getAttachments());
|
||||
$this->assertSame(DefaultSceneProvider::$data, $v->getData());
|
||||
|
||||
@@ -179,7 +179,7 @@ class GameTest extends CoreModelTestCase
|
||||
// For now, I cant seem to serialize a proper ActionGroup to store in
|
||||
// the yaml for this test suite, so build one naturally :)
|
||||
$v = $this->g->getViewpoint();
|
||||
$a = $v->getActions()[0]->getActions()[0];
|
||||
$a = $v->getActionGroups()[0]->getActions()[0];
|
||||
$this->assertNotNull($a);
|
||||
|
||||
$s = $this->getEntityManager()->find(Scene::class, $a->getDestinationSceneId());
|
||||
|
||||
@@ -96,13 +96,13 @@ class CharacterViewpointTest extends CoreModelTestCase
|
||||
];
|
||||
|
||||
$input = $em->getRepository(CharacterViewpoint::class)->find(2);
|
||||
$input->setActions($actionGroups);
|
||||
$input->setActionGroups($actionGroups);
|
||||
$input->save($em);
|
||||
|
||||
$em->clear();
|
||||
|
||||
$output = $em->getRepository(CharacterViewpoint::class)->find(2);
|
||||
$this->assertEquals($actionGroups, $output->getActions());
|
||||
$this->assertEquals($actionGroups, $output->getActionGroups());
|
||||
}
|
||||
|
||||
public function testAttachments()
|
||||
|
||||
@@ -15,7 +15,7 @@ character_viewpoints:
|
||||
template: "lotgd/tests/village"
|
||||
data: "a:0:{}"
|
||||
attachments: "a:0:{}"
|
||||
actions: "a:0:{}"
|
||||
actionGroups: "a:0:{}"
|
||||
scenes:
|
||||
-
|
||||
id: 1
|
||||
|
||||
@@ -19,7 +19,7 @@ character_viewpoints:
|
||||
template: "lotgd/tests/village"
|
||||
data: "a:0:{}"
|
||||
attachments: "a:0:{}"
|
||||
actions: "a:0:{}"
|
||||
actionGroups: "a:0:{}"
|
||||
scenes:
|
||||
-
|
||||
id: 1
|
||||
|
||||
Reference in New Issue
Block a user