<commit_before><?php namespace Devise\Pages;

use Mockery as m;

class PageManagerTest extends \DeviseTestCase
{
    public function setUp()
    {
        parent::setUp();
        $Framework = new \Devise\Support\Framework;
        $this->DvsPage = new \DvsPage;
        $this->PageVersionManager = m::mock('Devise\Pages\PageVersionManager');
        $this->PageManager = new PageManager($this->DvsPage, $this->PageVersionManager, $Framework);
    }

    public function test_it_creates_new_page()
    {
        $this->PageVersionManager->shouldReceive('createDefaultPageVersion')->times(1)->andReturn(new \DvsPageVersion);
        $page = $this->PageManager->createNewPage(['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'view' => 'some.view.path']);
        assertNotFalse($page);
        assertInstanceOf('DvsPageVersion', $page->version);
        assertEquals($page->title, 'Some page title');
    }

    public function test_it_updates_page()
    {
        $page = $this->PageManager->updatePage(1, ['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'view' => 'some.view.path']);
        assertEquals('Some page title', $page->title);
    }

    public function test_it_destroys_page()
    {
        $this->PageManager->destroyPage(1);<commit_msg>Fixed constructor dependencies in PageManagerTest.<commit_after><?php namespace Devise\Pages;

use Mockery as m;

class PageManagerTest extends \DeviseTestCase
{
    public function setUp()
    {
        parent::setUp();

        $Framework = new \Devise\Support\Framework;
        $this->DvsPage = new \DvsPage;
        $this->PageVersionManager = m::mock('Devise\Pages\PageVersionManager');
        $this->PageVersionsRepository = m::mock('Devise\Pages\PageVersionsRepository');
        $this->FieldsRepository = m::mock('Devise\Pages\Fields\FieldsRepository');
        $this->FieldManager = m::mock('Devise\Pages\Fields\FieldManager');

        $this->PageManager = new PageManager($this->DvsPage, $this->PageVersionManager, $this->PageVersionsRepository, $this->FieldsRepository, $this->FieldManager, $Framework);
    }

    public function test_it_creates_new_page()
    {
        $this->PageVersionManager->shouldReceive('createDefaultPageVersion')->times(1)->andReturn(new \DvsPageVersion);
        $page = $this->PageManager->createNewPage(['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'view' => 'some.view.path']);
        assertNotFalse($page);
        assertInstanceOf('DvsPageVersion', $page->version);
        assertEquals($page->title, 'Some page title');
    }

    public function test_it_updates_page()
    {
        $page = $this->PageManager->updatePage(1, ['title' => 'Some page title', 'slug' => '/some-page-title', 'http_verb' => 'get', 'view' => 'some.view.path']);
        assertEquals('Some page title', $page->title);
    }

    public function test_it_destroys_page()
    {
        $this->PageManager->destroyPage(1);
{'fraction_non_alphanumeric': 0.16333333333333333, 'fraction_numerical': 0.002, 'mean_word_length': 3.7786624203821657, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1679266', 'n_tokens_mistral': 897, 'n_tokens_neox': 892, 'n_words': 160}