Validation change for Text type EAV attributes#64
Closed
tim-reynolds wants to merge 4 commits intomagento:masterfrom
Closed
Validation change for Text type EAV attributes#64tim-reynolds wants to merge 4 commits intomagento:masterfrom
tim-reynolds wants to merge 4 commits intomagento:masterfrom
Conversation
The call on Mage_Eav_Model_Attribute_Data_Text:67 to empty returns true of a value of "0" is entered, as specified in the PHP spec. This prevents the entry of zero on the backend admin for fields. Zero should be a valid value, as it was in our case. No unit tests were created, as no unit tests exist currently for the Eav module.
Sorry for not including this originally.
Contributor
|
@tim-reynolds-briteskies
Changes will be available on the GitHub with one of the nearest code publications from the internal repository. Closing the ticket as complete. Thank you. |
Contributor
Author
|
Thank you for the detailed write up. This was my first attempt at unit testing Magento2 so I was pretty sure what I did could have been done better. I look forward to seeing the final result. Thanks! |
magento-team
added a commit
that referenced
this pull request
Oct 9, 2012
* Performance Testing Framework improvements: * Added ability to specify fixtures per scenario * Implemented Magento application cleanup between scenarios * Implemented support of PHP scenarios. The framework distinguishes type of the scenario by its extension: `jmx` or `php` * Added ability to skip warm-up for a certain scenario * JMeter scenarios are run with `jmeter` command instead of `java -jar ApacheJmeter.jar`. It's impossible to specify path to JMeter tool now, it should be accessible from command line as `jmeter` * Implemented fixture for Performance Tests with 80k products distributed among 200 categories * Tax rule management UI simplified: * Added `Jeditable` jQuery library * Added multiselect fields for customer tax class, product tax class and tax rate * Added ability to add/edit Tax Rate directly from Tax Rule page * Simplified product creation workflow: * Added product types dropdown to "Add Product" button. Default attribute set is used for product creation * "Add Product" button opens form for Simple product with Default attribute set * Attribute set can be changed from product creation form * Implemented auto-generation of product SKU and meta fields. The templates can be configured in `System -> Configuration -> Catalog -> Catalog -> Product Fields Auto-Generation` * Added ability to unassign system attribute from an attribute set, if it's not "Minimal" one * Specified UI IDs for base Backend elements. UI ID is represented as HTML "id" attribute intended to identify certain HTML element * Refactored `Catalog_Model_Product_Indexer_Flat::matchEvent()` method - reduced cyclomatic complexity * Updated DB structure to make possible to store Themes' and Widgets' layout updates * Migration to jQuery: * Replaced Ajax, Dialog and Template mechanisms with jQuery analogs * Added jQuery loader for translation process * Migrated Inline-Translator to jQuery * JavaScript improvements: * Implemented `editTrigger` jQuery widget intended to display "Edit" button for elements it is attached to * Fixes: * Incorrect title for "Currency Symbols" page on Backend * References to website, store and store view aren't displayed on Backend, if Single Store mode is disabled * "Store" column and dropdown are displayed on `System -> Import/Export -> DataFlow-Profiles` page, when Single Store mode is enabled * Options are absent for `'tax_class_id'` product attribute * No exception/error message is produced, when attempting to commit/rollback asymmetric DB transaction * Links are not copied during downloadable product duplication * PayPal tab is absent in `System -> Configuration -> Sales` section * "Edit" link in wishlist opens Product View page instead of "Configure Product" page * Default value for a product attribute is not saved * Escaped HTML blocks with `Mage_Core_Helper_Data::jsonEncode`, where necessary * Impossible to add new Dataflow profile * Impossible to specify default option for new product attribute with "dropdown" type * Unable to send the email when creating new invoice/shipment/credit memo * "Segmentation Fault" in Integration tests * GitHub requests: * [#36](#36) -- added ability to force set of "Include Tax" option for catalog prices * [#63](#63) -- removed obsolete "args" node in event subscribers * [#64](#64) -- fixed EAV text attribute validation for "0" value * [#72](#72) -- fixed collecting shipping totals for case, when previous invoice value is 0
This was referenced Nov 22, 2015
magento-team
pushed a commit
that referenced
this pull request
Mar 23, 2016
JS-328: Drag/swipe of vertical thumbnails stopped working on mobile devices
Closed
magento-engcom-team
pushed a commit
that referenced
this pull request
Aug 26, 2018
MAGETWO-91493: MDC Framework Issues. Message passed as a service to T…
5 tasks
1 task
5 tasks
5 tasks
5 tasks
5 tasks
5 tasks
5 tasks
magento-devops-reposync-svc
pushed a commit
that referenced
this pull request
Feb 5, 2026
…ethods
Fixed 3 test failures by using proper PHPUnit 12 pattern.
Files fixed:
1. AbstractBlockTest::testGetVar - 1 test ✅
- Changed deprecated createMock(AbstractBlock, $constructorArgs)
- To: getMockBuilder()->setConstructorArgs()->onlyMethods([])->getMock()
2. SearchResultTest - 2 tests ✅
- Changed createMock(SearchResult) which returns null for all methods
- To: getMockBuilder()->onlyMethods([])->getMock()
- This allows real method implementations (setTotalCount, getTotalCount, etc.)
Pattern: When tests need real method implementations to work:
$mock = $this->getMockBuilder(Class::class)
->disableOriginalConstructor() // Skip constructor if needed
->onlyMethods([]) // Don't override any methods
->getMock();
This creates a partial mock that allows all real methods to execute while
still being able to configure specific method behaviors if needed.
Commit #64 - Fixed 3 more test failures
Remaining: 12 failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The call on Mage_Eav_Model_Attribute_Data_Text:67 to empty returns true of a value of "0" is entered, as specified in the PHP spec. This prevents the entry of zero on the backend admin for fields. Zero should be a valid value, as it was in our case.
Unit test added. I apologize for not including that initially. I closed the other pull request.