我的自定义扩展中有几个模型,这些模型仅用于填充实体的添加/编辑形式中的某些选择和/或多项选择。
因此,它们被magento称为“源模型”。
所涉及的值始终相同,并且方法返回的内容相同。
我应该如何对它们进行单元测试?甚至更好,我应该为他们编写单元测试吗?
这是一个例子。
下列类用于添加/编辑表单(称为)的字段type以及同一字段的Grid列。  
<?php
namespace Sample\News\Model\Author\Source;
use Magento\Framework\Option\ArrayInterface;
class Type implements ArrayInterface
{
    const COLLABORATOR = 1;
    const EMPLOYEE = 2;
    /**
     * Get options
     *
     * @return array
     */
    public function toOptionArray()
    {
        $_options = [
            [
                'value' => '',
                'label' => ''
            ],
            [
                'value' => self::COLLABORATOR,
                'label' => __('Collaborator')
            ],
            [
                'value' => self::EMPLOYEE,
                'label' => __('Employee')
            ],
        ];
        return $_options;
    }
    /**
     * get options as key value pair
     *
     * @return array
     */
    public function getOptions()
    {
        $_tmpOptions = $this->toOptionArray();
        $_options = [];
        foreach ($_tmpOptions as $option) {
            $_options[$option['value']] = $option['label'];
        }
        return $_options;
    }
}