Example #1
0
	def test_snippet(self):
		module = Module(package='Package', name='Name', description='Description')
		snippet = ConsoleSnippet(module)
		sample_output = snippet.add('test', 'test console')

		result = utils.CodeSniffer.generate_and_test(module)
		self.assertTrue(result)
Example #2
0
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = ObserverSnippet(module)
        sample_output = snippet.add('catalog_product_save_after')

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = ApiSnippet(module)
        sample_output = snippet.add(api_name='SampleAPI', api_method='GET')

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = PluginSnippet(module)
        sample_output = snippet.add('Magento\\Catalog\\Model\\Product',
                                    'getName')

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)
	def test_snippet_ajax(self):
		module = Module(package='Package', name='Name', description='Description')
		snippet = ControllerSnippet(module)
		sample_output = snippet.add(
			frontname='test', 
			section='index', 
			action='index', 
			adminhtml=False, 
			ajax=True)

		result = utils.CodeSniffer.generate_and_test(module)
		self.assertTrue(result)
	def test_snippet(self):
		module = Module(package='Package', name='Name', description='Description')
		snippet = CategoryAttributeSnippet(module)
		sample_output = snippet.add(
			attribute_label='test', 
			frontend_input='select', 
			scope=1, 
			required=False, 
			source_model='custom', 
			source_model_options='value1, value2, value3')

		result = utils.CodeSniffer.generate_and_test(module)
		self.assertTrue(result)
Example #7
0
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = ModelSnippet(module)
        sample_output = snippet.add(model_name='test',
                                    field_name='name',
                                    field_type='text',
                                    adminhtml_grid=True,
                                    adminhtml_form=True,
                                    web_api=True)

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)
Example #8
0
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = SystemSnippet(module)
        sample_output = snippet.add(
            tab='test',
            section='test',
            group='test',
            field='test',
            field_type='select',
            new_tab=False,
            source_model='custom',
            source_model_options='value1, value2, value3')

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)
Example #9
0
    def test_snippet(self):
        module = Module(package='Package',
                        name='Name',
                        description='Description')
        snippet = CustomerAttributeSnippet(module)
        sample_output = snippet.add(
            attribute_label='test',
            customer_forms=False,
            customer_address_forms=False,
            customer_entity='customer',
            frontend_input='text',
            static_field_type='varchar',
            required=False,
            source_model='custom',
            source_model_options='value1, value2, value3')

        result = utils.CodeSniffer.generate_and_test(module)
        self.assertTrue(result)