<commit_before><?php

namespace Markup\Bundle\JobQueueBundle\Tests\Service;

use Markup\JobQueueBundle\Job\SleepJob;
use Markup\JobQueueBundle\Service\JobManager;
use Mockery as m;
use Symfony\Component\Validator\Constraints\DateTime;

class JobManagerTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $jobPublisher = m::mock('Markup\JobQueueBundle\Publisher\JobPublisher');
        $scheduledJob = m::mock('Markup\JobQueueBundle\Service\ScheduledJobService');
        $jobPublisher->shouldReceive('publish')->andReturn(null);
        $scheduledJob->shouldReceive('addScheduledJob')->andReturn(null);
        $this->jobManager = new JobManager($jobPublisher, $scheduledJob);
    }

    public function testCanAddJob()
    {
        $job = new SleepJob();
        $scheduledTime = new DateTime();
        $this->assertNull($this->jobManager->addJob($job));
        $this->assertNull($this->jobManager->addJob($job, $scheduledTime));
    }

    public function testDoesNotAcceptBadJobs()
    {
        $badjob = 'console:herp:derp';
        $this->setExpectedException('PHPUnit_Framework_Error');
        $this->jobManager->addJob($badjob);
    }

    public function testCanAddCommandJob()
    {
        $this->assertNull($this->jobManager->addCommandJob('console:herp:derp', 'system', 60, 60));
    }

    public function tearDown()
    {
        m::close();
    }
}
<commit_msg>Update JobManagerTest.php<commit_after><?php

namespace Markup\Bundle\JobQueueBundle\Tests\Service;

use Markup\JobQueueBundle\Job\SleepJob;
use Markup\JobQueueBundle\Service\JobManager;
use Mockery as m;
use Symfony\Component\Validator\Constraints\DateTime;

class JobManagerTest extends \PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $jobPublisher = m::mock('Markup\JobQueueBundle\Publisher\JobPublisher');
        $scheduledJob = m::mock('Markup\JobQueueBundle\Service\ScheduledJobService');
        $jobPublisher->shouldReceive('publish')->andReturn(null);
        $scheduledJob->shouldReceive('addScheduledJob')->andReturn(null);
        $this->jobManager = new JobManager($jobPublisher, $scheduledJob);
    }

    public function testCanAddJob()
    {
        $job = new SleepJob();
        $scheduledTime = new \DateTime();
        $this->assertNull($this->jobManager->addJob($job));
        $this->assertNull($this->jobManager->addJob($job, $scheduledTime));
    }

    public function testDoesNotAcceptBadJobs()
    {
        $badjob = 'console:herp:derp';
        $this->setExpectedException('PHPUnit_Framework_Error');
        $this->jobManager->addJob($badjob);
    }

    public function testCanAddCommandJob()
    {
        $this->assertNull($this->jobManager->addCommandJob('console:herp:derp', 'system', 60, 60));
    }

    public function tearDown()
    {
        m::close();
    }
}

{'fraction_non_alphanumeric': 0.13868356212601196, 'fraction_numerical': 0.0028159098908834917, 'mean_word_length': 3.7845117845117846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, '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': '7535140', 'n_tokens_mistral': 877, 'n_tokens_neox': 836, 'n_words': 121}