Skip to content

Commit

Permalink
Fix others imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrossi committed Aug 6, 2017
1 parent b130462 commit d542b7d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Field/Term.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Term extends BasicField implements FieldInterface
protected $items;

/**
* @var \Corcel\Term
* @var \Corcel\Model\Term
*/
protected $term;

Expand All @@ -29,7 +29,7 @@ class Term extends BasicField implements FieldInterface
public function __construct(Post $post)
{
parent::__construct($post);
$this->term = new \Corcel\Term();
$this->term = new \Corcel\Model\Term();
$this->term->setConnection($post->getConnectionName());
}

Expand Down
8 changes: 4 additions & 4 deletions src/Field/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
class User extends BasicField implements FieldInterface
{
/**
* @var \Corcel\User
* @var \Corcel\Model\User
*/
protected $user;

/**
* @var \Corcel\User
* @var \Corcel\Model\User
*/
protected $value;

Expand All @@ -28,7 +28,7 @@ class User extends BasicField implements FieldInterface
public function __construct(Post $post)
{
parent::__construct($post);
$this->user = new \Corcel\User();
$this->user = new \Corcel\Model\User();
$this->user->setConnection($post->getConnectionName());
}

Expand All @@ -42,7 +42,7 @@ public function process($fieldName)
}

/**
* @return \Corcel\User
* @return \Corcel\Model\User
*/
public function get()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/CorcelIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Corcel\Model\Post;

/**
* Class CorcelIntegrationTest.
*
Expand Down
7 changes: 4 additions & 3 deletions tests/LayoutFieldsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Corcel\Acf\Field\Repeater;
use Corcel\Acf\Field\FlexibleContent;
use Corcel\Model\Post;

/**
* Class LayoutFieldsTest.
Expand Down Expand Up @@ -35,7 +36,7 @@ public function testComplexRepeaterField()
$this->assertEquals('admin', $fields[1]['fake_user']->nickname);
$this->assertEquals(2, $fields[0]['fake_relationship']->count());
$this->assertEquals(1, $fields[1]['fake_relationship']->count());
$this->assertInstanceOf('Corcel\Post', $fields[0]['fake_relationship']->first());
$this->assertInstanceOf(Post::class, $fields[0]['fake_relationship']->first());
}


Expand All @@ -52,10 +53,10 @@ public function testFlexibleContentField()
$this->assertEquals('Lorem ipsum', $layout[0]->fields->text);

$this->assertEquals('related_post', $layout[1]->type);
$this->assertInstanceOf('Corcel\Post', $layout[1]->fields->post);
$this->assertInstanceOf(Post::class, $layout[1]->fields->post);

$this->assertEquals('multiple_posts', $layout[2]->type);
$this->assertEquals(2, $layout[2]->fields->post->count());
$this->assertInstanceOf('Corcel\Post', $layout[2]->fields->post->first());
$this->assertInstanceOf(Post::class, $layout[2]->fields->post->first());
}
}

0 comments on commit d542b7d

Please sign in to comment.