<commit_before><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 * @package   Zend_Barcode
 */

namespace ZendTest\Barcode\Renderer;

use Zend\Barcode;
use Zend\Barcode\Object;
use Zend\Barcode\Renderer as RendererNS;

/**
 * @category   Zend
 * @package    Zend_Barcode
 * @subpackage UnitTests
 * @group      Zend_Barcode
 */
class ImageTest extends TestCommon
{
    public function setUp()
    {
        if (!extension_loaded('gd')) {
            $this->markTestSkipped('\ZendTest\Barcode\Renderer\ImageTest requires the GD extension');
        }
        parent::setUp();
    }

    protected function getRendererObject($options = null)
    {
        return new RendererNS\Image($options);
    }

    public function testType()
    {
        $this->assertSame('image', $this->renderer->getType());
    }

    public function testGoodImageResource()
    {
        $imageResource = imagecreatetruecolor(1, 1);
        $this->renderer->setResource($imageResource);
    }

    public function testObjectImageResource()
    {
        $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
        $imageResource = new \StdClass();
        $this->renderer->setResource($imageResource);
    }

    public function testGoodHeight()
    {
        $this->assertSame(0, $this->renderer->getHeight());
        $this->renderer->setHeight(123);
        $this->assertSame(123, $this->renderer->getHeight());
        $this->renderer->setHeight(0);
        $this->assertSame(0, $this->renderer->getHeight());
    }

    public function testBadHeight()
    {
        $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
        $this->renderer->setHeight(- 1);
    }

    public function testGoodWidth()
    {
        $this->assertSame(0, $this->renderer->getWidth());<commit_msg>stdClass with little 's'<commit_after><?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 * @package   Zend_Barcode
 */

namespace ZendTest\Barcode\Renderer;

use Zend\Barcode;
use Zend\Barcode\Object;
use Zend\Barcode\Renderer as RendererNS;

/**
 * @category   Zend
 * @package    Zend_Barcode
 * @subpackage UnitTests
 * @group      Zend_Barcode
 */
class ImageTest extends TestCommon
{
    public function setUp()
    {
        if (!extension_loaded('gd')) {
            $this->markTestSkipped('\ZendTest\Barcode\Renderer\ImageTest requires the GD extension');
        }
        parent::setUp();
    }

    protected function getRendererObject($options = null)
    {
        return new RendererNS\Image($options);
    }

    public function testType()
    {
        $this->assertSame('image', $this->renderer->getType());
    }

    public function testGoodImageResource()
    {
        $imageResource = imagecreatetruecolor(1, 1);
        $this->renderer->setResource($imageResource);
    }

    public function testObjectImageResource()
    {
        $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
        $imageResource = new \stdClass();
        $this->renderer->setResource($imageResource);
    }

    public function testGoodHeight()
    {
        $this->assertSame(0, $this->renderer->getHeight());
        $this->renderer->setHeight(123);
        $this->assertSame(123, $this->renderer->getHeight());
        $this->renderer->setHeight(0);
        $this->assertSame(0, $this->renderer->getHeight());
    }

    public function testBadHeight()
    {
        $this->setExpectedException('\Zend\Barcode\Renderer\Exception\ExceptionInterface');
        $this->renderer->setHeight(- 1);
    }

    public function testGoodWidth()
    {
        $this->assertSame(0, $this->renderer->getWidth());
{'fraction_non_alphanumeric': 0.1418643661634316, 'fraction_numerical': 0.01054397316079559, 'mean_word_length': 3.0682261208577, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5258077', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1244, 'n_words': 220}